Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Array.au3>
- #include <EditConstants.au3>
- #include <GUIConstantsEx.au3>
- #Include <GUIEdit.au3>
- #include <Math.au3>
- #include <Misc.au3>
- #Include <ScrollBarConstants.au3>
- #include <WindowsConstants.au3>
- ; =========== MIGHT NEED TO MODIFY THIS IF VERSION CHANGES ===========
- $path = @UserProfileDir & "\AppData\Local\Google\Chrome\User Data\Default\Extensions\eopfmbpfhhfnklgmjpoehcjaajhpbhbl\1.0.0.11_0\game.canvas.js"
- ; =========== WEAPON HACKS ===========
- $clipSize = 1000000 ; default = 2
- $reloadDuration = 0.2 ; default = 1.5
- $rechamberDuration = 0.2 ; default = 0.4
- $maxRange = 100 ; default = 10
- ; =========== BULLET HACKS ===========
- $bDamage = 1000 ; default = 20, 40, 60, 80, 100
- $nearRange = 50 ; default = 3
- $farRange = 100 ; default = 7.5
- $radius = 100 ; default = 10,
- $arcAngle = 180 ; default = 30,
- ; =========== STRUCTURE HACKS ===========
- $sHealth = 9000000
- $buildTime = 0
- $resourceCost = 0
- $secondaryResourceCost = 0
- $minResourceRepairCost = "[0,0]"
- $maxResourceRepairCost = "[0,0]"
- $sDdamage = 5000
- $friendlyFire = 0 ; Explosions (decimal percentage, ex. 0.2 = 20%)
- $reloadDuration = 1 ; Turrets
- $maxAttackers = 200 ; Decoy
- ; =========== HERO HACKS ===========
- ; Health
- $hHealth = 5000000 ; default = 50 at lv 1
- $regen = 5000 ; default = 15
- $regenDelay = 1 ; default = 2
- ; Movement
- $normalSpeed = 12 ; default = 5
- $fastSpeed = 20 ; default = 8
- ; =========== RESOURCE HACKS ===========
- ; Resource Nodes Never Deplete
- ; Add Amber When Spending
- ; Attract Radius
- $attractRadius = 20 ; How far you can pick up resources from
- ; Deposit Radius
- $depositRadius = 200 ; How far you can deposit resources from
- ; Lumber & Stone Multiplier
- $multiplier = 10 ; Not sure this is a perfect multiplier because it seemed like more than 10 in my tests
- ; ===================================================================================================================================================
- ; ===================================================================================================================================================
- ; ===================================================================================================================================================
- $str = FileRead($path)
- $hGUI = GUICreate("Hack Log",800,600)
- GUISetStyle(BitOR($WS_CAPTION,$WS_DLGFRAME,$WS_SYSMENU))
- $hEdit = GUICtrlCreateEdit("",10,10,780,580)
- GUISetState(@SW_SHOW)
- Func AddLine($text)
- $iEnd = StringLen(GUICtrlRead($hEdit))
- _GUICtrlEdit_SetSel($hEdit, $iEnd, $iEnd)
- _GUICtrlEdit_Scroll($hEdit, $SB_SCROLLCARET)
- GUICtrlSetData($hEdit, $text & @CRLF, 1)
- EndFunc
- AddLine("WEAPON HACKS:")
- $str = StringRegExpReplace($str,"(?s)(wp_h_shotgun_cone..=\s*\{[^}]*?clipSize:\s*)[\dE\.]*(,[^}]*?reloadDuration:\s*)[\dE\.]*(,[^}]*?rechamberDuration:\s*)[\dE\.]*(,[^}]*?maxRange:\s*)[\dE\.]*(,.*?})","${1}" & $clipSize & "${2}" & $reloadDuration & "${3}" & $rechamberDuration & "${4}" & $maxRange & "${5}")
- AddLine(@TAB & _Iif(@error=0,"Sucessfully changed " & @extended / 5 & " results","Failed"))
- AddLine("BULLET HACKS:")
- $str = StringRegExpReplace($str,"(?s)(dg_h_shotgun_blast_cone..=[^}]*?damage:\s*)[\dE\.]*(,[^}]*?nearRange:\s*)[\dE\.]*(,[^}]*?farRange:\s*)[\dE\.]*(,[^}]*?radius:\s*)[\dE\.]*(,[^}]*?arcAngle:\s*)[\dE\.]*(,.*?})","${1}" & $bDamage & "${2}" & $nearRange & "${3}" & $farRange & "${4}" & $radius & "${5}" & $arcAngle & "${6}")
- AddLine(@TAB & _Iif(@error=0,"Sucessfully changed " & @extended / 6& " results","Failed"))
- AddLine("STRUCTURE HACKS:")
- $results = StringRegExp($str,'(?s)(a_d_[^\{}"]*?:{)([^}]*})',3)
- For $i=0 To UBound($results)-1 Step 2
- $search = $results[$i] & $results[$i+1]
- $replace = $search
- If StringLeft($results[$i],8) <> "a_d_mine" Then $replace = StringRegExpReplace($replace,"(health:\s*)[\dE]*","${1}" & $sHealth)
- $replace = StringRegExpReplace($replace,"(buildTime:\s*)[\dE]*","${1}" & $buildTime)
- $replace = StringRegExpReplace($replace,"(resourceCost:\s*)[\dE]*","${1}" & $resourceCost)
- $replace = StringRegExpReplace($replace,"(secondaryResourceCost:\s*)[\dE]*","${1}" & $secondaryResourceCost)
- $replace = StringRegExpReplace($replace,"(minResourceRepairCost:\s*)\[[\dE]*,[\dE]*]","${1}" & $minResourceRepairCost)
- $replace = StringRegExpReplace($replace,"(maxResourceRepairCost:\s*)\[[\dE]*,[\dE]*]","${1}" & $maxResourceRepairCost)
- $replace = StringRegExpReplace($replace,"(damage:\s*)[\dE]*","${1}" & $sDdamage)
- $replace = StringRegExpReplace($replace,"(friendlyFire:\s*)[\dE\.]*","${1}" & $friendlyFire)
- $replace = StringRegExpReplace($replace,"(reloadDuration:\s*)[\dE\.]*","${1}" & $reloadDuration)
- $str = StringReplace($str,$search,$replace,1,2)
- AddLine(@TAB & StringTrimRight($results[$i],2))
- Next
- AddLine("HERO HACKS:")
- $str = StringRegExpReplace($str,"(?s)(ECHealth:{[^}]*?,health:\s*)50(,[^}]*?regen:\s*)15(,[^}]*?regenDelay:\s*)2(,.*?})","${1}" & $hHealth & "${2}" & $regen & "${3}" & $regenDelay & "${4}")
- AddLine(@TAB & "Health: " & _Iif(@error=0,"Sucessfully changed " & @extended / 4 & " results","Failed"))
- $str = StringRegExpReplace($str,"(?s)(ECLocomotion:{\s*normalSpeed:\s*)5(,\s*fastSpeed:\s*)8(,.*?})","${1}" & $normalSpeed & "${2}" & $fastSpeed & "${3}")
- AddLine(@TAB & "Movement: " & _Iif(@error=0,"Sucessfully changed " & @extended / 3 & " results","Failed"))
- AddLine("RESOURCE HACKS:")
- $str = StringRegExpReplace($str,"claimResource:function\(a\){this\.claimedResource\+=a","claimResource:function(a){this.claimedResource+=0")
- AddLine(@TAB & "Resource Nodes Never Deplete (Part 1): " & _Iif(@error=0,"Sucessfully changed " & @extended & " results","Failed"))
- $str = StringRegExpReplace($str,"(growFactor|resource)-=d[^;]*;","${1}-=0;")
- AddLine(@TAB & "Resource Nodes Never Deplete (Part 2): " & _Iif(@error=0,"Sucessfully changed " & @extended & " results","Failed"))
- $str = StringRegExpReplace($str,"(adjustSoftCurrency\()-","${1}")
- AddLine(@TAB & "Add Amber When Spending: " & _Iif(@error=0,"Sucessfully changed " & @extended & " results","Failed"))
- $str = StringRegExpReplace($str,"(?s)(attractRadius:\s*(?:[^}]*?defaultValue:\s*)?)\d*,","${1}" & $attractRadius & ",")
- AddLine(@TAB & "Attract Radius: " & _Iif(@error=0,"Sucessfully changed " & @extended & " results","Failed"))
- $str = StringRegExpReplace($str,"applyToEntitiesInGridCellsWithinRadius\(this\.getv3Location\(\),2,c\)","applyToEntitiesInGridCellsWithinRadius(this.getv3Location()," & $depositRadius & ",c)")
- AddLine(@TAB & "Deposit Radius (Part 1): " & _Iif(@error=0,"Sucessfully changed " & @extended & " results","Failed"))
- $str = StringRegExpReplace($str,"4>c\.getDistanceUsingSize\(a\)",$depositRadius & ">c\.getDistanceUsingSize\(a\)")
- AddLine(@TAB & "Deposit Radius (Part 2): " & _Iif(@error=0,"Sucessfully changed " & @extended & " results","Failed"))
- $str = StringRegExpReplace($str,"(adjustResource:function\(a,b,?c?\){)","${1}b=b*" & $multiplier & ";")
- AddLine(@TAB & "Lumber & Stone Multiplier: " & _Iif(@error=0,"Sucessfully changed " & @extended & " results","Failed"))
- AddLine("___________________________________________________________________________________________________")
- ;~ ; Create backup then write file
- $backup = $path & "." & @YEAR & @MON & @MDAY & "." & @HOUR & @MIN & @SEC & ".bak"
- $backupStatus = FileCopy($path,$backup)
- If Not $backupStatus Then ClipPut($str)
- AddLine("Backup " & _Iif($backupStatus,"Created: " & $backup, "Failed: However, the modified code should now be copied to your clipboard." & @CRLF & @TAB & "Create a new file named game.canvas.js and paste the code in." & @CRLF & @TAB & "Then create your own backup of """ & $path & """, and move your new file into that folder."))
- If $backupStatus Then
- FileDelete($path)
- $fileWriteStatus = FileWrite($path,$str)
- If Not $fileWriteStatus Then ClipPut($str)
- AddLine("File modification " & _Iif($fileWriteStatus, "successful!", "Failed: However, the modified code should now be copied to your clipboard." & @CRLF & @TAB & "Open """ & $path & """, delete its contents and paste in the new code."))
- EndIf
- AddLine("___________________________________________________________________________________________________")
- AddLine("DONE!")
- Do
- Local $msg = GUIGetMsg()
- Until $msg = $GUI_EVENT_CLOSE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement