Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Include <File.au3>
- #Include <MsgBoxConstants.au3>
- Global $file = @ScriptDir & "\saltlick.txt"
- getFighters()
- Func getFighters()
- Global $leftChoose = InputBox("Find a fight","Who is fighting on the left side?")
- Global $rightChoose = InputBox("Find a fight","Who is fighting on the right side?")
- Global $search = $leftChoose&"*"&$rightChoose
- Global $src = 0
- Global $srcnum = 1
- Global $fileLines = _FileCountLines($file)
- Global $revFlag = 0
- setSearch()
- EndFunc
- Func setSearch()
- If $src == 0 Then
- FileOpen($file, $FO_READ)
- search()
- EndIf
- EndFunc
- Func search()
- Do
- $sFileRead = FileReadLine($file, $srcnum)
- If StringInStr($sFileRead, $search) Then ;;If the string fragment is found in the file
- $aSpl = StringSplit($sFileRead, "+") ;;Split everything before probability
- If $revFlag == 1 Then ;;If the string has been reversed, reverse the everything else
- $aRevSpl = StringSplit($aSpl[2], ":")
- If $aSpl[3] == "R" Then
- $aSpl[3] = "L"
- Else
- $aSpl[3] = "R"
- EndIf
- MsgBox($MB_SYSTEMMODAL, "Odds", "Left: "&$leftChoose&" | Right: "&$rightChoose&@CRLF&"Win Probability: "&$aRevSpl[2]&":"&$aRevSpl[1]&@CRLF&"Historical outcome: "&$aSpl[3]&@CRLF&@CRLF&"Date recorded: "&$aSpl[4])
- Else
- MsgBox($MB_SYSTEMMODAL, "Odds", "Left: "&$leftChoose&" | Right: "&$rightChoose&@CRLF&"Win Probability: "&$aSpl[2]&@CRLF&"Historical outcome: "&$aSpl[3]&@CRLF&@CRLF&"Date recorded: "&$aSpl[4])
- EndIf
- ElseIf $srcnum == $fileLines AND $revFlag = 0 Then ;;If string isn't in the file and string hasn't been reversed
- $revFlag = 1 ;;Flag to reverse the search string
- $srcnum = 1
- $search = $rightChoose&"*"&$leftChoose
- setSearch()
- ExitLoop
- Else
- $srcnum+=1
- search()
- EndIf
- Until 1
- EndFunc
- ;;Try this out, let me know what you think. If you can figure out how to scrape the text from the Salty Bets webpage (www.saltybet.com), then please let me know. Thanks :) - /u/Bloody_Spork
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement