Skip to content

Commit

Permalink
v4.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
gquito committed Oct 5, 2021
1 parent 12425cf commit 13cdb9c
Show file tree
Hide file tree
Showing 73 changed files with 1,692 additions and 435 deletions.
21 changes: 20 additions & 1 deletion msl-bot/bin/_src/globals/Const.au3
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Global Const $g_sLocalOriginalFolder = $g_sLocalFolder & "original\"
Global Const $g_sLocalDataFolder = $g_sLocalFolder & "data\"
Global Const $g_sProfileFolder = @ScriptDir & "\profiles\"
Global Const $g_sRemoteUrl = "https://raw.githubusercontent.com/GkevinOD/msl-bot/version-check/data/"
Global Const $g_sFilterFolder = $g_sProfileFolder & "gem_filters\"

Global Const $g_sScriptListFile = @ScriptDir & "\bin\local\scriptlist.txt"

Expand All @@ -54,6 +55,12 @@ Global Const $g_sAirshipTrees = "airship-trees.txt"
Global Const $g_sScripts = "free_scripts_4.2.0.txt"

Global Const $g_sPackageName = "com.ftt.msleague_gl"
Global Const $g_sPackageActivity = "kr.co.smartstudy.tamagorpg.TamagoMainActivity"

Global Const $g_aGem_Grade = ["6", "5", "4", "3", "2", "1", "any"]
Global Const $g_aGem_Shape = ["square", "triangle", "diamond", "any"]
Global Const $g_aGem_Type = ["leech", "siphon", "pugilist", "ruin", "intuition", "conviction", "protection", "valor", "vitality", "tenacity", "fortitude", "healing", "ferocity", "life", "any"]
Global Const $g_aGem_Stat = ["hp", "attack", "defense", "recovery", "critrate", "critdmg", "resist", "any"]

Global Const $g_aGemRanks = ["LEECH,SIPHON,PUGILIST", "RUIN", "INTUITION", "CONVICTION,PROTECTION,VALOR,VITALITY,TENACITY,FORTITUDE,HEALING,FEROCITY", "LIFE"]
Global Const $g_aGemGrade6Price = [[39600,37799,36000,34199], [24750,23624,22500,21374], [19800,18899,18000,17099]]
Expand All @@ -73,8 +80,8 @@ Global Const $g_aGem_pixelTypes = [ _
"PUGILIST:414,219,0xDDA456|415,223,0xE9AE5A|419,223,0xDCA456|431,229,0xA17341|434,229,0xDFA657|438,219,0xD29C52", _
"SIPHON:418,219,0xDDA356|420,225,0xD69D54|422,224,0xD69D54|430,224,0xDCA356|446,224,0xE2A858", _
"RUIN:323,224,0xE8AE5A|411,223,0xEAAF5B|435,225,0xDCA456/363,223,0xE8AE5A|403,223,0xEFB45C|411,223,0xEAAF5B", _
"FEROCITY:352,223,0xE4AA58|400,223,0xEBB05B|446,224,0xE5AB59", _
"FORTITUDE:348,223,0xE8AE5A|396,223,0xEBB05B|446,224,0xF0B45D", _
"FEROCITY:352,223,0xE4AA58|400,223,0xEBB05B|446,224,0xE5AB59", _
"HEALING:354,224,0xE0A757|402,223,0xF0B45C|444,225,0xDFA657", _
"VALOR:360,224,0xE8AE5A|391,224,0xECB15B|436,225,0xECB15B", _
"INTUITION:351,223,0xDDA556|390,222,0xF4B75E|399,223,0xDAA255", _
Expand Down Expand Up @@ -108,6 +115,18 @@ Global Const $g_aVillagePos = [ _
"150,430,0x7F4863|34,334,0xD298D5|635,182,0xDB82C9/790,350,0x00FFFF|4,381,0xC1C1AF|331,163,0x02FFFF/661,62,0x44575E|573,398,0x565D46|357,360,0x444D3F", _
"221,87,0x44687A|41,395,0x00FFFF|476,163,0x01FFFF/221,87,0x424B44|41,395,0x00FFFF|476,163,0x00FFFF/104,451,0x44332E|784,401,0xC0C0AF|507,75,0x0885C7/104,451,0x44332E|784,401,0xC4C4B2|507,75,0x1079A7/272,374,0x444B44|755,457,0x4A4A39|8,194,0x2F3D46/272,374,0x444B44|755,457,0x0F0D0A|8,194,0x2D2D29"]

; 0,1,2: Normal | 3,4: Windsinger | 5,6: Albatross | 7,8: Hanamura
Global Const $g_aExpeditionPos = [ _ ; Use getVillagePos() function
"231,246", _ ; Index = 0
"-1", _ ; Index = 1
"327,185", _ ; Index = 2
"-1", _ ; Needed. Index = 3
"-1", _ ; Needed. Index = 4
"-1", _ ; Needed. Index = 5
"-1", _ ; Needed. Index = 6
"299,254", _ ; Index = 7
"463,315"] ; Index = 8

Global Const $g_aVillageTrees = [ _
"296,115|486,67|683,107|685,289", _
"182,390|194,122|577,81|627,186", _
Expand Down
4 changes: 4 additions & 0 deletions msl-bot/bin/_src/globals/Default.au3
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Global $Default_Config_Profile_Name = "Default"
Global $Default_Config_Scheduled_Restart = "Game:3H"
Global $Default_Config_Location_Stuck_Timeout = "10 Minutes"
Global $Default_Config_Screen_Frozen_Check = "60 Seconds"
Global $Default_Config_ADB_Game_Check = "30 Seconds"
Global $Default_Config_Another_Device_Timeout = "Immediately"
Global $Default_Config_Maintenance_Timeout = "5 Minutes"
Global $Default_Config_Save_Logs = "Enabled"
Expand All @@ -23,6 +24,7 @@ Global $Default_Config_Back_Mode = "ADB"
Global $Default_ADB_Device = "~AUTO"
Global $Default_ADB_PC_Shared = "~AUTO"
Global $Default_ADB_Android_Shared = "~AUTO"
Global $Default_ADB_Restart_Game = "Enabled"

Global $Default_Delay_Script_Loop = "200"
Global $Default_Delay_Swipe_Delay = "700"
Expand All @@ -38,7 +40,9 @@ Global $Default_General_Max_Exotic_Chips = "20"

Global $Default_Hourly_Hourly_Script = "Enabled"
Global $Default_Hourly_Collect_Hiddens = "Enabled"
Global $Default_Hourly_Collect_Inbox = "Enabled"
Global $Default_Hourly_Click_Nezz = "Disabled"
Global $Default_Hourly_Expedition = "Enabled"

Global $Default_Guardian_Guardian_Script = "Enabled"
Global $Default_Guardian_Guardian_Mode = "Both"
Expand Down
4 changes: 0 additions & 4 deletions msl-bot/bin/_src/globals/Handles.au3
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ Global $g_idScheduleAdd_Cancel = Null
Global $g_idScheduleAdd_Preset = Null
Global $g_iScheduleType = Null

Global $g_hMessageBox = Null
Global $g_idEditMessage = Null

Global $g_hCurrentEdit = Null

;UI Handles
Expand Down Expand Up @@ -101,7 +98,6 @@ Global $g_hBtn_CaptureRegion = Null
;Timer Handles
Global $g_hTimerLocation = Null ;Global timer for location. Used for antiStuck
Global $g_hGetLocationCoolDown = TimerInit() ;Cooldown for getLocation function
Global $g_hTimerScheduledRestart = Null ;Global timer for schedules restart.

Global $g_hGameCheckCD = TimerInit()

Expand Down
4 changes: 3 additions & 1 deletion msl-bot/bin/_src/globals/Numbers.au3
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ Global $g_aGemsToSell = Null

Global $g_iLocationIndex = -1 ;Location map index

Global $g_aStatsCD = TimerInit() ;Cooldown timer handle for updating stats listview
Global $g_aStatsCD = TimerInit() ;Cooldown timer handle for updating stats listview

Global $g_bCaptureQuest = False
11 changes: 7 additions & 4 deletions msl-bot/bin/_src/gui/Config.au3
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,15 @@ EndFunc

;Helper Functions----------------------------------------------------------------------

Global Const $CONFIG_NEVER = -1, $CONFIG_IMMEDIATELY = 0
Func Config_Parse($sValue)
Switch $sValue
Case "Enabled", "Disabled"
Return $sValue == "Enabled"
Case "Never"
Return -1
Return $CONFIG_NEVER
Case "Immediately"
Return 0
Return $CONFIG_IMMEDIATELY
Case Else
If StringInStr($sValue, "Hours") Then
$sValue = Int(StringMid($sValue, 1, StringLen($sValue) - StringLen(" Hours")))
Expand All @@ -121,9 +122,11 @@ EndFunc

Func Config_CreateGlobals($aSetting, $sName)
For $i = 0 To UBound($aSetting)-1
If $aSetting[$i][1] == "~DEFAULT" Then ContinueLoop

If $aSetting[$i][1] == "~DEFAULT" Then
Assign($sName & "_" & $aSetting[$i][0], Config_Parse(Eval("Default_" & $sName & "_" & $aSetting[$i][0])), $ASSIGN_FORCEGLOBAL)
Else
If StringLeft($sName, 1) == "_" Then $sName = StringMid($sName, 2)
Assign($sName & "_" & $aSetting[$i][0], Config_Parse($aSetting[$i][1]), $ASSIGN_FORCEGLOBAL)
EndIf
Next
EndFunc
129 changes: 129 additions & 0 deletions msl-bot/bin/_src/gui/Design.au3
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Func CreateGUI()
GUICtrlCreateMenuItem("", $Menu_General)
Global $M_General_Debug_Input = GUICtrlCreateMenuItem("Debug Input...", $Menu_General)
Global $M_General_Compatibility_Test = GUICtrlCreateMenuItem("Compatibility Test...", $Menu_General)
GUICtrlCreateMenuItem("", $Menu_General)
Global $M_General_Toggle_Hidden = GUICtrlCreateMenuItem("Toggle Hidden", $Menu_General)

Global $Menu_ADB = GUICtrlCreateMenu("ADB", $Menu_Debug)
Global $M_ADB_Run_Command = GUICtrlCreateMenuItem("Run Command...", $Menu_ADB)
Expand All @@ -52,15 +54,23 @@ Func CreateGUI()
Global $M_Location_Set_Location = GUICtrlCreateMenuItem("Set Location...", $Menu_Location)
Global $M_Location_Test_Location = GUICtrlCreateMenuItem("Test Location", $Menu_Location)

Global $Menu_Gem = GUICtrlCreateMenu("Gem")
Global $M_Gem_Gem_Window = GUICtrlCreateMenuItem("Gem Window...", $Menu_Gem)

Global $Menu_Pixel = GUICtrlCreateMenu("Pixel", $Menu_Debug)
Global $M_Pixel_Check_Pixel = GUICtrlCreateMenuItem("Check Pixel...", $Menu_Pixel)
Global $M_Pixel_Set_Pixel = GUICtrlCreateMenuItem("Set Pixel...", $Menu_Pixel)
Global $M_Pixel_Get_Color = GUICtrlCreateMenuItem("Get Color...", $Menu_Pixel)

Global $Menu_Scripts = GUICtrlCreateMenu("Scripts")
Global $M_Scripts_Hourly = GUICtrlCreateMenuItem("Hourly", $Menu_Scripts)
Global $M_Scripts_Expedition = GUICtrlCreateMenuItem("Expedition", $Menu_Scripts)
Global $M_Scripts_Collect_Quest = GUICtrlCreateMenuItem("Collect Quest", $Menu_Scripts)
Global $M_Scripts_Collect_Inbox = GUICtrlCreateMenuItem("Collect Inbox", $Menu_Scripts)
Global $M_Scripts_Guardian_Dungeon = GUICtrlCreateMenuItem("Guardian Dungeon", $Menu_Scripts)
GUICtrlCreateMenuItem("", $Menu_Scripts)
Global $M_Scripts_Titans_Fast = GUICtrlCreateMenuItem("Toggle Titans Fast", $Menu_Scripts)


Global $Menu_Capture = GUICtrlCreateMenu("Capture")
Global $M_Capture_Full_Screenshot = GUICtrlCreateMenuItem("Full Screenshot", $Menu_Capture)
Expand Down Expand Up @@ -418,3 +428,122 @@ Func UpdatePicture($aCursor = $g_aPoint_UpdatePicture_Cache)
Return $aResult
EndIf
EndFunc

Global $g_hCompatibilityTest = Null
Func ScriptTest_CreateGui($sMessage, ByRef $hBitmap)
If $g_hCompatibilityTest <> Null Then Return SetError(1, 0, False)
$g_hCompatibilityTest = GUICreate("MSL-Bot Compatibility Test", 823, 367, -1, -1, -1, -1, $g_hParent)
Global $g_idCompatibilityTest_editMain = GUICtrlCreateEdit($sMessage, 10, 10, 296, 307, $WS_VSCROLL, -1)
Global $g_idCompatibilityTest_picMain = GUICtrlCreatePic("", 309, 10, 507, 350, -1, -1)
Global $g_idCompatibilityTest_btnClose = GUICtrlCreateButton("Close", 260, 330, 46, 30, -1, -1)
Global $g_idCompatibilityTest_btnCopyText = GUICtrlCreateButton("Copy Text", 10, 330, 80, 30, -1, -1)
Global $g_idCompatibilityTest_btnCopyImage = GUICtrlCreateButton("Copy as Image", 96, 330, 160, 30, -1, -1)

GUISetState(@SW_SHOW, $g_hCompatibilityTest)

Local $tagSize = _WinAPI_GetBitmapDimension($hBitmap)
Local $aImageSize = [DllStructGetData($tagSize, 'X'), DllStructGetData($tagSize, 'Y')]
If $aImageSize[0] = 0 Or $aImageSize[1] = 0 Then Return SetError(2, 0, False)

Local $hAdjusted = _WinAPI_AdjustBitmap($hBitmap, 507, 350)

_WinAPI_DeleteObject(GUICtrlSendMsg($g_idCompatibilityTest_picMain, $STM_SETIMAGE, $IMAGE_BITMAP, $hAdjusted))
_WinAPI_DeleteObject($hAdjusted)

Return $g_hCompatibilityTest
EndFunc

Global $g_hGemWindow = Null
Global $g_aGemWindow_GemsFound[0]
Global $g_iGemWindow_GemsFound = 0
Func GemWindow_CreateGui()
If $g_hGemWindow <> Null Then Return SetError(1, 0, False)
$g_hGemWindow = GUICreate("Gem Window", 327, 286, -1, -1, -1, -1, $g_hParent)
Global $g_idGemWindow_tabMain = GUICtrlCreateTab(3, 1, 322, 282)
GUICtrlSetResizing(-1, $GUI_DOCKAUTO+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
Global $g_idGemWindow_pageFilter = GUICtrlCreateTabItem("Filter")
Global $g_idGemWindow_lblAction = GUICtrlCreateLabel("Action:", 16, 33, 37, 17)
Global $g_idGemWindow_cmbAction = GUICtrlCreateCombo("", 56, 31, 185, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "Create...|Remove...|Save...|Help...", "Create...")
Global $g_idGemWindow_btnGo = GUICtrlCreateButton("Go", 244, 29, 71, 25)
Global $g_idGemWindow_lblCurrent = GUICtrlCreateLabel("Current Filter:", 16, 64, 66, 17)

;Combo items from files in gem_filters
Global $g_idGemWindow_cmbFilter = GUICtrlCreateCombo("", 84, 62, 230, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
Local $aFiles = _FileListToArray($g_sFilterFolder)
If isArray($aFiles) = True And $aFiles[0] > 0 Then
GUICtrlSetData(-1, _ArrayToString($aFiles, "|", 1), $aFiles[1])
EndIf

;Set edit to file contents if it exists
Local $sCurrent = GUICtrlRead(-1)
Global $g_idGemWindow_editFilter = GUICtrlCreateEdit("", 10, 88, 306, 188, BitOR($ES_AUTOHSCROLL, $ES_WANTRETURN, $WS_HSCROLL))
If $sCurrent <> "" Then
Local $sContent = FileRead($g_sFilterFolder & $sCurrent)
If @error Then GUICtrlSetData(-1, "Error: Could not load filter.")
If @error = 0 Then GUICtrlSetData(-1, $sContent)
EndIf

GUICtrlSetFont(-1, 12, 400, 0, "MS Reference Sans Serif")
Global $g_idGemWindow_pageGemsFound = GUICtrlCreateTabItem("Gems Found")
Global $g_idGemWindow_btnNext = GUICtrlCreateButton("Next", 190, 250, 100, 25)
Global $g_idGemWindow_btnPrevious = GUICtrlCreateButton("Previous", 37, 250, 100, 25)
Global $g_idGemWindow_lblGemsFilter = GUICtrlCreateLabel("Filter:", 15, 36, 29, 17)
Global $g_idGemWindow_inpFilter = GUICtrlCreateInput("Does not work yet", 44, 34, 190, 21)
GUICtrlSetState(-1, $GUI_DISABLE)
Global $g_idGemWindow_btnFilter = GUICtrlCreateButton("Filter", 237, 32, 75, 25)
GUICtrlSetState(-1, $GUI_DISABLE)
Global $g_idGemWindow_editGem = GUICtrlCreateEdit("", 11, 59, 304, 186, BitOR($ES_READONLY,$ES_WANTRETURN))
GUICtrlSetData(-1, StringFormat("Gem #: 0/0\r\nStatus: N/A\r\nGrade: N/A\r\nShape: N/A\r\nStat: N/A\r\nSub1: N/A\r\nSub2: N/A\r\nSub3: N/A\r\nSub4: N/A"))
GUICtrlSetFont(-1, 11, 400, 0, "MS Reference Sans Serif")

GUISetState(@SW_SHOW)

Return $g_hGemWindow
EndFunc

; [[handle, close_event_function]]
Global $g_hListEditor[0][2]
; [[listview, btn_moveup, btn_down, btn_remove, btn_add, combo]]
Global $g_hListEditor_Controls[0][6]
Func ListEditor_CreateGui($aCurrent, $aDefault, $sFunction)
Local $aWinPos = WinGetPos($g_hParent)
Local $x = -1, $y = -1
If isArray($aWinPos) = True Then
$x = $aWinPos[0]+(($aWinPos[2]-150)/2)
$y = $aWinPos[1]+(($aWinPos[3]-150)/2)
EndIf
Local $hListEditor = GUICreate("Edit List", 150, 182, $x, $y, -1, $WS_EX_TOPMOST, $g_hParent)

Local $idListEditor_listMain = GUICtrlCreateListView("", 2, 2, 146, 100, $LVS_SINGLESEL+$LVS_REPORT+$LVS_NOSORTHEADER+$WS_BORDER, $LVS_EX_DOUBLEBUFFER+$LVS_EX_FULLROWSELECT+$LVS_EX_GRIDLINES)
_GUICtrlListView_AddColumn($idListEditor_listMain, "-Included Values-", 125, 2)
ControlDisable("", "", HWnd(_GUICtrlListView_GetHeader($idListEditor_listMain))) ;Prevents changing column size

Local $idlistEditor_btnMoveUp = GUICtrlCreateButton("Move up", 2, 104, 72)
Local $idlistEditor_btnMoveDown = GUICtrlCreateButton("Move down", 75, 104, 72)
Local $idlistEditor_btnRemove = GUICtrlCreateButton("Remove", 2, 129, 145)
Local $idlistEditor_btnAdd = GUICtrlCreateButton("Add", 2, 154, 42)

Local $idlistEdit_cmbMain = GUICtrlCreateCombo("", 46, 155, 100, -1, $CBS_DROPDOWNLIST)
_GUICtrlComboBox_SetItemHeight($idlistEdit_cmbMain, 17)

;Set values for listview and combo
For $i = 0 To UBound($aCurrent)-1
If ($aCurrent[$i] <> "") Then _GUICtrlListView_AddItem($idListEditor_listMain, $aCurrent[$i])

;Removing existing values from default to add those non exisiting in a combo later.
For $j = UBound($aDefault)-1 To 0 Step -1
If ($aDefault[$j] = $aCurrent[$i]) Then _ArrayDelete($aDefault, $j)
Next
Next

If isArray($aDefault) Then GUICtrlSetData($idlistEdit_cmbMain, _ArrayToString($aDefault))
_GUICtrlComboBox_SetCurSel($idlistEdit_cmbMain, 0)

GUISetState(@SW_SHOW, $hListEditor)

_WinAPI_SetFocus($hListEditor)
_ArrayAdd($g_hListEditor, _ArrayToString(CreateArr($hListEditor, $sFunction)))
_ArrayAdd($g_hListEditor_Controls, _ArrayToString(CreateArr($idListEditor_listMain, $idlistEditor_btnMoveUp, $idlistEditor_btnMoveDown, $idlistEditor_btnRemove, $idlistEditor_btnAdd, $idlistEdit_cmbMain)))
Return $hListEditor
EndFunc
Loading

0 comments on commit 13cdb9c

Please sign in to comment.