Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; ———————————————————————
- ; ----- To do: -----
- ; ———————————————————————
- ; Update Nav, fix rndnav, add AaNav, NavSelect
- ; Add troop SleepTimer
- ; close menu loop , update HD bot
- ; make high/lowres buttons represent actual resolution values 1920x1080p
- ;
- ; ———————————————————————
- ; ----- on_init -----
- ; ———————————————————————
- ;
- #NoEnv
- #Warn
- SendMode Input
- #Persistent
- #SingleInstance Force
- #WinActivateForce
- #NoTrayIcon
- ;
- ; Set Coord Mode
- ;
- CoordMode, Mouse, Window
- CoordMode, Pixel, Window
- ;
- ; ———————————————————————
- ; ----- GUI -----
- ; ———————————————————————
- ;
- Gui, Font,, Verdana
- Gui, Font, cc2e0d5 s10 w500 q4
- Gui, Add, Text, c7fbea7e x10 y0, HanniBot_r38a
- Gui, Add, Text, c00cc84 x152 y0, (Public_Release)
- Gui, Add, Text, cc2e0d5 x10 y18, Created by BotBear and Kuma
- Gui, Add, Text, cWhite x10 y33, ______________________________
- Gui, Add, Text, c7fbea7e x94 y51, Instructions:
- Gui, Add, Text, x40 y70, Press F4 to Reload the Bot
- Gui, Add, Text, x40 y88, Press F5 to Pause the Bot
- Gui, Add, Text, x40 y106, Press F6 to Quit the Bot
- Gui, Add, Text, cWhite x10 y122, ______________________________
- Gui, Add, Text, c7fbea7e x94 y140, Configuration:
- Gui, Add, Text, x10 y167, BotMode:
- Gui, Add, DDL, vBotMode x100 y165, LowRes||HighRes
- Gui, Add, Text, x10 y195, Commander:
- Gui, Add, DDL, vCommander x100 y193, Default||Arminius|Boudica|Caesar|Germanicus|Hannibal|Sulla
- ;Gui, Add, Text, x10 y222, Troops:
- ;Gui, Add, DDL, vTroops x100 y220, Default||Cavalry|Elephant|Infantry|Archer
- Gui, Add, Button, x100 y226 gLoadProgram, Activate and Hide ;y242
- Gui, +AlwaysOnTop +ToolWindow
- Gui, Color, 222222 ;494949 (replace this color code if u want it fully transparent)
- Gui, Show, x800 y50, HanniBot_r38a
- WinSet, Transcolor, 494949, HanniBot_r38a
- return
- ; ———————————————————————
- ; ----- Buttons -----
- ; ———————————————————————
- ;
- LoadProgram:
- {
- Gui, Submit
- sleep, 500
- GoSub, Program
- return
- }
- F4::reload
- F5::pause
- F6::ExitApp
- F8:: ; Leave Battle
- GoSub, EndBattle
- return
- ;
- ; ———————————————————————
- ; ----- Logic -----
- ; ———————————————————————
- ;
- Program:
- ;SetTimer, TimesUp, 3600000 ; =/= 1 hr ;remove the comment tag before compiling (if you want it timed for 1 hr)
- if BotMode = LowRes ;BearBot
- loop {
- WinActivate, Total War: Arena
- sleep, 500
- GoSub, StartBattle
- Sleep, 500
- GoSub, AttackNav
- Sleep 500
- GoSub, CloseSummary
- Sleep, 500
- GoSub, EndBattle
- Sleep 1000
- return
- }
- if BotMode = HighRes ;KumaBot
- {
- loop
- {
- WinActivate, Total War: Arena
- sleep, 500
- GoSub, MenuLoop1
- sleep, 500
- GoSub, FocusUnits
- sleep, 500
- GoSub, UseAbility
- sleep, 500
- GoSub, AttackLoop
- sleep, 500
- GoSub, MenuLoop2
- sleep, 20000
- return
- }
- }
- ; ———————————————————————
- ; ----- Subroutines ----- (Both Versions & Experimental)
- ; ———————————————————————
- ;
- ; ———————————————————————
- ; -------- Timer -------
- ; ———————————————————————
- ; Timer for trial version
- TimesUp:
- MsgBox, Your 60 minutes of testing are up! Closing in 3...2...1..
- Sleep, 3600
- ExitApp
- ;
- ; --------------------
- ; --- Chat Modules ---
- ; --------------------
- ;
- ;Chat_GG: ;chat module "GG" ~2s
- ;SendInput {Shift Down}Enter{Shift Up}
- ;sleep, 500
- ;SendInput {g}{g}
- ;sleep, 500
- ;SendInput {Enter}
- ;sleep, 1000
- ;
- ;Chat_GLHF: ;chat module "GL HF" ~2s
- ;SendInput {Shift Down}Enter{Shift Up}
- ;sleep, 400
- ;SendInput {g}{l}
- ;sleep, 400
- ;SendInput {space}
- ;sleep, 400
- ;SendInput {h}{f}
- ;sleep, 400
- ;SendInput {Enter}
- ;sleep, 400
- ;
- ;Chat_lol: ;chat module "lol" ~2s
- ;SendInput {Shift Down}Enter{Shift Up}
- ;sleep, 500
- ;SendInput {l}{o}{l}
- ;sleep, 500
- ;SendInput {Enter}
- ;sleep, 1000
- ;
- ; --------------------
- ; --- UnitSleep ---
- ; --------------------
- UnitSleep: ;setting a SleepTimer for Nav
- {
- if Troops = Default
- return
- if Troops = Cavalry
- SleepTimer := 15000
- return
- if Troops = Elephant
- SleepTimer := 30000
- return
- if Troops = Infantry
- SleepTimer := 24000
- return
- if Troops = Archer
- SleepTimer := 20000
- return
- }
- ; --------------------
- ; --- UseAbility ---
- ; --------------------
- UseAbility:
- {
- if Commander = Default
- return
- if Commander = Arminius
- {
- SendInput {g}
- sleep, 500
- SendInput {h}
- sleep, 500
- if AttackCheck = 1
- {
- SendInput {f}
- sleep, 500
- }
- return
- }
- if Commander = Boudica
- {
- SendInput {f}
- sleep, 500
- if AttackCheck = 1
- {
- SendInput {h}
- sleep, 500
- }
- return
- }
- if Commander = Caesar
- {
- SendInput {g}
- sleep, 500
- if AttackCheck = 1
- {
- SendInput {f}
- sleep, 500
- }
- return
- }
- if Commander = Germanicus
- {
- SendInput {f}
- sleep, 500
- if AttackCheck = 1
- {
- SendInput {h}
- sleep, 500
- }
- return
- }
- if Commander = Hannibal
- {
- SendInput {f}
- sleep, 500
- if AttackCheck = 1
- {
- SendInput {g}
- sleep, 500
- SendInput {h}
- sleep, 500
- }
- return
- }
- if Commander = Sulla
- {
- SendInput {g}
- sleep, 500
- if AttackCheck = 1
- {
- SendInput {h}
- sleep, 500
- }
- return
- }
- }
- ; ———————————————————————
- ; ----- Subroutines ----- (LowRes) >>>> BearMode
- ; ———————————————————————
- ;
- ; --------------------
- ; --- StartBattle ---
- ; --------------------
- StartBattle:
- PixelSearch, aX, aY, 659, 22, 659, 22, 0xFFFFFF, *2, Fast RGB
- if errorlevel = 0 ;if play button is active
- {
- Sleep, 500 ; prevents an error when looping
- MouseClick, left, 683,515 ; close levelup
- Sleep, 500
- MouseClick, left, 677,714 ; close button
- Sleep, 4000
- MouseClick, left, 673,21 ; play button
- Sleep, 100
- return
- }
- if errorlevel = 1 ;if play button is inactive
- {
- Sleep, 100
- MouseClick, left, 683,515 ; close levelup
- Sleep, 500
- MouseClick, left, 677,714 ; close button
- sleep, 800
- MouseClick, left, 128,14 ; squad
- sleep, 800
- MouseClick, left, 120,300 ; commander 1
- sleep, 1200
- MouseClick, left, 673,21 ; play button
- sleep, 1500
- MouseClick, left, 128,14 ; squad
- sleep, 800
- MouseClick, left, 80,500 ; commander 2
- sleep, 1200
- MouseClick, left, 673,21 ; play button
- Sleep, 800
- return
- }
- ; --------------------
- ; --- AttackNav ---
- ; --------------------
- AttackNav:
- {
- PixelSearch, nX, nY, 1352, 648, 1352, 648, 0xFFFFFF ; check if we are in battle
- if errorlevel = 0 ;if we are in battle
- {
- ; check NavSelect for Navigation Pattern: (deprecated missing NavSelect variable)
- ;if NavSelect = 1
- {
- GoSub, UseAbility
- sleep, 500
- GoSub, DefaultNav ;~180s
- return
- }
- ;if NavSelect = 2
- ;{
- ;GoSub, UseAbility
- ;sleep, 500
- ;GoSub, SimpleNav ;~160s
- ;return
- ;}
- ;if NavSelect = 3
- ;{
- ;GoSub, UseAbility
- ;sleep, 500
- ;GoSub, CircleNav ;~120s
- ;return
- ;}
- ;if NavSelect = 4
- ;{
- ;GoSub, UseAbility
- ;sleep, 500
- ;GoSub, CoCircleNav ;~120s
- ;return
- ;}
- ;if NavSelect = 5
- ;{
- ;GoSub, UseAbility
- ;sleep, 500
- ;GoSub, CounterNav ;~120s
- ;return
- ;}
- }
- if errorlevel = 1 ;if not in battle skip and continue.
- sleep, 500 ; slight pause to prevent problems
- return
- }
- ; --------------------------
- ; - Behaviors (AttackNav) -
- ; --------------------------
- DefaultNav:
- sleep, 200
- SendInput {1}
- Sleep, 200
- SendInput {1}
- Sleep, 2400
- SendInput {Ctrl Down}a{Ctrl Up}
- sleep, 100
- SendInput {z}
- MouseClick, right, 1160,600 ;D3
- Sleep, 24000
- SendInput {Ctrl Down}a{Ctrl Up}
- sleep, 100
- SendInput {z}
- MouseClick, right, 1212,625 ;E5
- Sleep, 24000
- SendInput {Ctrl Down}a{Ctrl Up}
- sleep, 100
- SendInput {z}
- MouseClick, right, 1265,600 ;D7
- Sleep, 24000
- SendInput {Ctrl Down}a{Ctrl Up}
- sleep, 100
- SendInput {z}
- MouseClick, right, 1265,675 ;G7
- sleep, 24000
- SendInput {Ctrl Down}a{Ctrl Up}
- sleep, 100
- SendInput {z}
- MouseClick, right, 1212,625 ;E5
- Sleep, 24000
- SendInput {Ctrl Down}a{Ctrl Up}
- sleep, 100
- SendInput {z}
- MouseClick, right, 1165,675 ;G3
- Sleep, 20000
- return
- ; --------------------
- SimpleNav:
- sleep, 200
- SendInput {1}
- Sleep, 200
- SendInput {1}
- Sleep, 2400
- SendInput {Ctrl Down}a{Ctrl Up}
- sleep, 100
- SendInput {z}
- MouseClick, right, 1190,575 ;C4
- Sleep, 20000
- SendInput {Ctrl Down}a{Ctrl Up}
- sleep, 100
- SendInput {z}
- MouseClick, right, 1215,666 ;G5
- Sleep, 20000
- SendInput {Ctrl Down}a{Ctrl Up}
- sleep, 100
- SendInput {z}
- MouseClick, right, 1300,565 ;C8
- Sleep, 20000
- SendInput {Ctrl Down}a{Ctrl Up}
- sleep, 100
- SendInput {z}
- MouseClick, right, 1215,666 ;G5
- Sleep, 20000
- SendInput {Ctrl Down}a{Ctrl Up}
- sleep, 100
- SendInput {z}
- MouseClick, right, 1275,700 ;H7
- Sleep, 20000
- SendInput {Ctrl Down}a{Ctrl Up}
- sleep, 100
- SendInput {z}
- MouseClick, right, 1212,625 ;E5
- Sleep, 20000
- SendInput {Ctrl Down}a{Ctrl Up}
- sleep, 100
- SendInput {z}
- MouseClick, right, 1165,700 ;H3
- Sleep, 20000
- SendInput {Ctrl Down}a{Ctrl Up}
- sleep, 100
- SendInput {z}
- MouseClick, right, 1212,625 ;E5
- Sleep, 20000
- return
- ; --------------------
- CircleNav:
- sleep, 200
- SendInput {1}
- Sleep, 200
- SendInput {1}
- Sleep, 2400
- SendInput {Ctrl Down}a{Ctrl Up}
- sleep, 100
- SendInput {z}
- MouseClick, right, 1140,555 ;B2
- Sleep, 30000
- SendInput {Ctrl Down}a{Ctrl Up}
- sleep, 100
- SendInput {z}
- MouseClick, right, 1290,550 ;B8
- Sleep, 30000
- SendInput {Ctrl Down}a{Ctrl Up}
- sleep, 100
- SendInput {z}
- MouseClick, right, 1300,725 ;i8
- Sleep, 30000
- SendInput {Ctrl Down}a{Ctrl Up}
- sleep, 100
- SendInput {z}
- MouseClick, right, 1140,725 ;i2
- Sleep, 30000
- return
- ; --------------------
- CoCircleNav:
- sleep, 200
- SendInput {1}
- Sleep, 200
- SendInput {1}
- Sleep, 2400
- SendInput {Ctrl Down}a{Ctrl Up}
- sleep, 100
- SendInput {z}
- MouseClick, right, 1140,725 ;i2
- Sleep, 30000
- SendInput {Ctrl Down}a{Ctrl Up}
- sleep, 100
- SendInput {z}
- MouseClick, right, 1300,725 ;i8
- Sleep, 30000
- SendInput {Ctrl Down}a{Ctrl Up}
- sleep, 100
- SendInput {z}
- MouseClick, right, 1290,550 ;B8
- Sleep, 30000
- SendInput {Ctrl Down}a{Ctrl Up}
- sleep, 100
- SendInput {z}
- MouseClick, right, 1140,555 ;B2
- Sleep, 30000
- return
- ; --------------------
- CounterNav:
- sleep, 200
- SendInput {1}
- Sleep, 200
- SendInput {1}
- Sleep, 2400
- SendInput {Ctrl Down}a{Ctrl Up}
- sleep, 100
- SendInput {z}
- MouseClick, right, 1165,675 ;G3
- Sleep, 20000
- SendInput {Ctrl Down}a{Ctrl Up}
- sleep, 100
- SendInput {z}
- MouseClick, right, 1212,625 ;E5
- Sleep, 20000
- SendInput {Ctrl Down}a{Ctrl Up}
- sleep, 100
- SendInput {z}
- MouseClick, right, 1265,675 ;G7
- Sleep, 20000
- SendInput {Ctrl Down}a{Ctrl Up}
- sleep, 100
- SendInput {z}
- MouseClick, right, 1265,600 ;D7
- Sleep, 20000
- SendInput {Ctrl Down}a{Ctrl Up}
- sleep, 100
- SendInput {z}
- MouseClick, right, 1212,625 ;E5
- Sleep, 20000
- SendInput {Ctrl Down}a{Ctrl Up}
- sleep, 100
- SendInput {z}
- MouseClick, right, 1160,600 ;D3
- Sleep, 20000
- return
- ; ----------------------------------------
- ; Experimental: (to be added)
- ;AaNav:
- ;loop {
- ;PixelSearch, aaX, aaY, 680, 420, 680, 420, 0xff0000, *2, Fast RGB
- ;
- ;if errorlevel = 0 ;if found
- ;{
- ;MouseClick, Right, %aaX%, %aaY% ; click red pixel
- ;return
- ;} break
- ;if errorlevel = 1 ;if not found
- ;return
- ;} continue
- ; ----------------------------------------
- ;RandomNav:
- ;loop 5 { ;do this x times.......
- ;viewport_X_min := amount
- ;viewport_X_max := amount
- ;viewport_Y_min := amount
- ;viewport_X_max := amount
- ;loop 2 {
- ;Random, NavX , %viewport_X_min%, %viewport_X_max% ; find a number between x1 and x2
- ;sleep, 200
- ;Random, NavY , %viewport_Y_min%, %viewport_Y_max% ; find a number between y1 and y2
- ;}
- ;SendInput {Ctrl Down}a{Ctrl Up}
- ;sleep, 200
- ;SendInput {z}
- ;sleep, 200
- ;MouseClick, Right, %NavX%,%NavY%
- ;sleep, %SleepTimer% ;
- ;return
- ;} ; ....we're doing this x times every x seconds at a random coordination on the minimap. if not possible, return
- ; --------------------
- ; --- CloseSummary ---
- ; --------------------
- CloseSummary:
- PixelSearch, cX, cY, 680, 420, 680, 420, 0x242424, *2, Fast RGB
- {
- if errorlevel = 0 ;if found
- {
- MouseClick, Left, 670,650 ; close summary
- return
- }
- if errorlevel = 1 ;if not found
- return
- }
- ; --------------------
- ; --- EndBattle ---
- ; --------------------
- EndBattle:
- {
- Sleep, 500 ; prevents an error when looping
- PixelSearch, eX, eY, 673, 657, 673, 657, 0xBEC6D2, *2, Fast RGB
- if errorlevel = 0 ;if our troops are dead:
- {
- Sleep, 500 ; prevents an error when looping
- SendInput {Escape}
- sleep, 600
- MouseClick, Left, 674, 437 ; LeaveBattle
- sleep, 600
- MouseClick, Left, 570, 488 ; LeaveBattleYes
- sleep, 8000
- return
- }
- if errorlevel = 1 ;if not skip and continue
- return
- }
- ; ——————————————————————————————————————————
- ; ʕ•ᴥ•ʔ Subroutines Kumabot [HIGH RES] ʕ•ᴥ•ʔ
- ; ——————————————————————————————————————————
- ; ʕ•ᴥ•ʔ Menu Loop 1 ʕ•ᴥ•ʔ
- ; ———————————————————————
- MenuLoop1:
- {
- Sleep, 500 ; prevents an error when looping
- MouseClick, Left, 1901, 51 ;click upper right to get out of summary
- sleep, 500
- MouseClick, Left, 989, 672 ;click close levelup button
- sleep, 500
- MouseClick, Left, 967, 21 ;click play button
- sleep, 500
- return
- }
- ; ʕ•ᴥ•ʔ Focus Units ʕ•ᴥ•ʔ
- ; ———————————————————————
- FocusUnits:
- {
- Sleep, 500 ; prevents an error when looping
- SendInput {1} {1} ;focus camera on units
- SendInput {ctrl down}a{ctrl up} ;select all units
- return
- }
- ; ʕ•ᴥ•ʔ AttackLoop ʕ•ᴥ•ʔ
- ; ——————————————————————
- AttackLoop:
- {
- Sleep, 500 ; prevents an error when looping
- PixelSearch, aX, aY, 1674, 868, 1903, 1057, 0xD20505, 0, Fast RGB ;searches for red in minimap
- if errorlevel = 0 ;if found
- {
- Sleep, 500 ; prevents an error when looping
- SendInput {z} ;to activate attack move
- MouseClick, Right, %aX%, %aY% ;to right click found enemy red pixel
- return
- }
- if errorlevel = 1 ;if not found
- return
- }
- ; ʕ•ᴥ•ʔ Menu Loop 2 ʕ•ᴥ•ʔ
- ; ———————————————————————
- MenuLoop2:
- {
- Sleep, 500 ; prevents an error when looping
- PixelSearch, aX, aY, 943, 959, 943, 959, 0xC8D2DE, 0, Fast RGB ;searches for gray color in the top part of the N in "Dead but Not Defeated"
- if errorlevel = 0 ;if found
- {
- Sleep, 500 ;prevents an error when looping
- MouseClick, Left, 1905, 13 ;options
- sleep, 500
- MouseClick, Left, 949, 591 ;end battle
- sleep, 500
- MouseClick, Left, 873, 645 ;yes
- sleep, 10000
- MouseClick, Left, 918, 1031 ;switch commander
- sleep, 1000
- MouseClick, Left, 386, 341 ;1st commander
- sleep, 1000
- MouseClick, Left, 907, 31 ;click play
- sleep, 1000
- MouseClick, Left, 398, 543 ;2nd commander
- sleep, 1000
- MouseClick, Left, 907, 31 ;click play
- sleep, 1000
- MouseClick, Left, 401, 723 ;3rd commander
- sleep, 1000
- MouseClick, Left, 907, 31 ;click play
- sleep, 1000
- MouseClick, Left, 123,871 ;4th commander
- sleep, 1000
- MouseClick, Left, 907, 31 ;click play
- return
- }
- if errorlevel = 1 ;if not found
- return
- }
- ; --------------------
- ; ------- end -------
- ; --------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement