Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Gui, Add, Tab2, x2 y-1 w480 h380 , Sand Crab|Misc
- Gui, Add, CheckBox, x22 y59 w120 h20 vareyoueating gareyoueatingthough, Eat?
- Gui, Add, ListBox, x362 y49 w60 h70 vlistfoodcolor, ; in progress
- Gui, Add, Button, x362 y29 w100 h20 vsetcolors gsetfoodcolor, Set Food Colors
- Gui, Add, GroupBox, x12 y39 w210 h130 , Food
- Gui, Add, Radio, x42 y89 w100 h20 veatoptionbank , Bank
- Gui, Add, Radio, x42 y119 w100 h20 veatoptionLogout , Logout / Alert
- Gui, Add, CheckBox, x12 y179 w210 h20 , Extra AntiBan
- Gui, Add, CheckBox, x12 y209 w210 h20 , CheckBox
- Gui, Add, Button, x362 y329 w100 h30 gBeginSandCrab vbeginbuttonlabel, Start
- Gui, Add, GroupBox, x252 y119 w210 h200 , Metrics
- Gui, Add, Text, x262 y139 w190 h20 vstatus, Status:Duration
- Gui, Add, Text, x262 y169 w190 h20 vcbtstatus, Not in combat. ;done
- Gui, Add, Text, x262 y199 w190 h20 vhealth, Health: ;done
- Gui, Add, Text, x262 y229 w190 h20 vprayer, Prayer: ;done
- Gui, Add, Text, x262 y259 w190 h20 veatlabel, Eating OFF
- Gui, Add, Text, x262 y289 w190 h20 , AntiBan
- Gui, Show, w479 h379, Jared
- SetTitleMatchMode 2
- WinActivate, RuneLite
- WinGetPos, RSWINX1, RSWINY1, RSWINX2, RSWINY2, RuneLite
- GuiControl,Disable, setcolors
- GuiControl,Disable, eatandbank
- GuiControl,Disable, eattilllog
- ;Variables---------------------------------
- ;Combat Status---
- cbtlocX1=16
- cbtlocY1=72
- cbtlocX2=19
- cbtlocY2=85
- CombatAliveColor=0x33860A
- CbtLastAlive=
- CbtDead=
- ;Health Check---
- 100hpx1=533
- 100hpy2=237
- 100hpx2=547
- 100hpy2=240
- hpdiff=25
- hpcolor=0x112584
- ;Prayer Check---
- 100px1=744
- 100py2=237
- 100px2=758
- 100py2=240
- pdiff=25
- pcolor=0x92952F
- ;Food List Array
- ListofFood := []
- foodlabelid=1
- foodyco=49
- ;SetTimer, RuneLiteStatus, 250 ;-fix this code
- toggle := 0
- return
- Rand(x,y) {
- Random, rand, %x%, %y%
- Return rand
- }
- BeginSandCrab:
- Gui, submit, NoHide
- GuiControl,,beginbuttonlabel, Stop(F12)
- GuiControlGet, foodlistcolor,, listfoodcolor
- if (toggle := !toggle) {
- goto, CombatRoutine
- } else {
- GuiControl,,beginbuttonlabel, Start
- }
- return
- MoveMouse(X, Y, Speed=25) {
- T := A_MouseDelay
- SetMouseDelay, -1
- MouseGetPos, CX, CY
- Pts := Round(Sqrt((X - CX)**2 + (Y - CY)**2) / Rand(0,3) ,0)
- Loop %Pts% {
- Random, NX, % CX - ((CX - X) / Pts) * (A_Index - 1)
- , % CX - ((CX - X) / Pts) * A_Index
- Random, NY, % CY - ((CY - Y) / Pts) * (A_Index - 1)
- , % CY - ((CY - Y) / Pts) * A_Index
- MouseMove, % NX, % NY, % Speed
- }
- MouseMove, % X, % Y, % Speed
- SetMouseDelay, % T
- }
- CombatRoutine:
- Msgbox, The bot will begin when you click ok.
- CheckLocation()
- SetTitleMatchMode 2
- WinActivate, RuneLite
- SetTimer, CombatStatus, 250
- SetTimer, HealthStatus, 1000
- SetTimer, PrayerStatus, 250
- SetTimer, Isyoueating, 250
- GuiControl,, status, Status:Ready
- Loop
- {
- CheckLocation()
- sleep, 5000 ; fix this. false positive, remove msgbox
- }
- return
- CheckLocation()
- {
- SetTitleMatchMode 2
- WinActivate, RuneLite
- CenterX1=251
- CenterY1=190
- CenterX2=259
- CenterY2=198
- HomeGroundTile=0x00DFDF
- PixelSearch, Xhometile, Yhometile, %CenterX1%, %CenterY1%, %CenterX2%, %CenterY2%, %HomeGroundTile%, 5, fast
- if ErrorLevel
- {
- PixelSearch, Xhometilea, Yhometilea, 9, 33, 518, 364, %HomeGroundTile%, 5, fast
- if ErrorLevel
- {
- ;msgbox, cant find color
- }
- else
- {
- ;Msgbox, Moving to HomeBase found color at %Xhometilea% and %Yhometilea% for %HomeGroundTile%
- mousemove, %Xhometilea%, Yhometilea-5, 10
- sleep, 300
- Mouseclick, Left
- GuiControl,, status, Status:Fighting Sand Crabs
- }
- }
- else
- {
- GuiControl,, status, Status:Fighting Sand Crabs
- }
- }
- Return
- ResetAgro()
- {
- GuiControl,, status, Status:Resetting Agro
- SetTitleMatchMode 2
- WinActivate, RuneLite
- RSgameinx1=9
- RSgameiny1=33
- RSgameinx2=518
- RSgameiny2=364
- ; ahkcolor-runelitecolor
- ;hometile=0x00FFFF-FFFFFF00
- ;walktile1=0x0000FF-FFFF0000
- ;walktile2=0xFF0026-FF2600FF
- ;walktile3=0xE700FF-FFFF00E7
- ;walktile4=0xE7FF00-FF00FFE7
- ;walktile5=0xCD0093-FFB700FF
- ColorArrayaway := ["0x0000FF", "0xFF0026", "0xE700FF", "0xE7FF00", "0xCD0093"]
- ColorArrayreturn := ["0xE7FF00", "0xE700FF", "0xFF0026","0x0000FF", "0x00FFFF"]
- for i, coloraway in ColorArrayaway
- {
- WinActivate, RuneLite
- PixelSearch, Xwalkcolor, Ywalkcolor, %RSgameinx1%, %RSgameiny1%, %RSgameinx2%, %RSgameiny2%, coloraway, 1, fast
- if ErrorLevel
- {
- FileAppend cant find walk tile
- }
- else
- {
- ;msgbox, found color %i% at %Xc% and %Yc%
- FileAppend found color %coloraway% at %Xwalkcolor% and %Xwalkcolor%`n, *
- MoveMouse(Xwalkcolor-Rand(5,10), Ywalkcolor-Rand(5,10), 10)
- sleep, Rand(80,200)
- MouseClick Left
- sleep, Rand(3500,4000)
- }
- }
- for i, colorreturn in ColorArrayreturn
- {
- WinActivate, RuneLite
- PixelSearch, Xwalkcolorreturn, Ywalkcolorreturn, %RSgameinx1%, %RSgameiny1%, %RSgameinx2%, %RSgameiny2%, colorreturn, 1, fast
- if ErrorLevel
- {
- FileAppend cant find walk tile
- }
- else
- {
- ;msgbox, found color %i% at %Xc% and %Yc%
- FileAppend found colorreturn %color% at %Xwalkcolorreturn% and %Ywalkcolorreturn%`n, *
- MoveMouse(Xwalkcolorreturn-5, Ywalkcolorreturn, 10)
- sleep, Rand(80,200)
- MouseClick Left
- sleep, Rand(3500,4500)
- }
- }
- GuiControl,, status, Status:Agro Reset
- sleep, 5000
- }
- Isyoueating:
- Gui, submit, NoHide
- If (eatoptionbank=1)
- GuiControl,, eatlabel, Eating ON Banking
- Else If (eatoptionLogout=1)
- GuiControl,, eatlabel, Eating ON Logging When out
- return
- RuneLiteStatus:
- ifWinActive, RuneLite
- {
- SetTimer, CombatStatus, 250
- SetTimer, HealthStatus, 250
- SetTimer, PrayerStatus, 250
- GuiControl,, status, Status:Ready
- }
- ifWinNotActive, RuneLite
- {
- GuiControl,, status, Status:RuneLite Client not Active
- SetTimer, CombatStatus, Off
- SetTimer, HealthStatus, Off
- SetTimer, PrayerStatus, Off
- }
- return
- ;Set food colors when eating.
- setfoodcolor:
- Msgbox, Please mouse over the food in your inventory, and press F1`n`nPLEASE SET 3 COLORS.
- foodlabelid=1
- foodyco=50
- return
- F1::
- if(listoffood.MaxIndex() >= 3 )
- {
- Msgbox, Only 3 colors are supported at this time
- return
- }
- MouseGetPos, MouseX, MouseY
- PixelGetColor, color, %MouseX%, %MouseY%
- sleep, 100
- ;GuiControl,, listfoodcolor,%color%
- listoffood.push(color)
- GuiControl,, listfoodcolor,%color%
- stringmid, R, color ,3 , 2
- stringmid, G, color,5,2
- stringmid, B, color,7,2
- Gui Add, Text, vfood%foodlabelid% x425 y%foodyco% c%B%%G%%R%, ||||||||||||||||||
- foodyco:=foodyco+14
- foodlabelid++
- sleep, 200
- return
- areyoueatingthough:
- GuiControlGet, areyoueating
- {
- if (areyoueating=1)
- {
- GuiControl,Enable, setcolors
- GuiControl,Enable, eatandbank
- GuiControl,Enable, eattilllog
- GuiControl,, eatlabel, Eating ON
- GuiControl,,eatoptionbank, 1
- }
- if (areyoueating=0)
- {
- GuiControl,Disable, setcolors
- GuiControl,, eatlabel, Eating OFF
- GuiControl,Disable, eatandbank
- GuiControl,Disable, eattilllog
- }
- }
- return
- ;---------------------------------------
- CombatStatus:
- GuiControlGet, Cbttext,, cbtstatus
- newstatus=
- Loop, 5
- {
- sleep,200
- PixelSearch, Xcbtstatus, Ycbtstatus, %cbtlocX1%, %cbtlocY1%, %cbtlocX2%, %cbtlocY2%, %CombatAliveColor%, 1, fast
- }
- if ErrorLevel
- {
- CbtDead:= A_TickCount
- {
- if (CbtDead <= CbtLastAlive+3000)
- {
- newstatus = Recently Dead Target.
- }
- if (CbtDead >= CbtLastAlive+3000)
- {
- newstatus = Not in combat.
- }
- if (CbtDead >= CbtLastAlive+Rand(10000,23000))
- {
- CbtDead=
- CbtLastAlive=
- ResetAgro()
- }
- }
- }
- else
- {
- CbtLastAlive:= A_TickCount
- newstatus = Combat Detected.
- }
- GuiControl,, cbtstatus, %newstatus%
- GuiControl,, status, Status:Fighting Sand Crabs
- Return
- HealthStatus: ; Check HP Status
- newhpleveltocheck:= 100hpy2
- GuiControlGet, hptext,, health
- newstatushp:=hplvlnum
- hplvlnum:=10
- invx1=563
- invy1=235
- invx2=731
- invy2=482
- PixelSearch, Xcbtstatus, Ycbtstatus, %100hpx1%, %100hpy1%, %100hpx2%, %100hpy2%, %hpcolor%, 5, fast
- if ErrorLevel
- {
- Loop, 10 {
- newhpleveltocheck:= newhpleveltocheck+hpdiff
- PixelSearch, Xcbtstatus, Ycbtstatus, %100hpx1%, %newhpleveltocheck%, %100hpx2%, newhpleveltocheck+3, %hpcolor%, 1, fast
- if ErrorLevel
- {
- hplvlnum--
- }
- else
- {
- hplvlnum--
- break
- }
- }
- }
- else
- {
- newstatushp = 100`%
- }
- GuiControlGet, hptext,, health
- If (newstatushp != hplvlnum)
- {
- newhp:= hplvlnum*10
- GuiControl,, health, %newhp%`%
- }
- If(hplvlnum<6)
- {
- sleep, Rand(2100,5100)
- Lookingfood :=true
- GuiControl,, status, Status:Eating
- for i, foods in listoffood
- {
- WinActivate, RuneLite
- While Lookingfood
- {
- PixelSearch, XFoodcolor, YFoodcolor, %invx1%, %invy1%, %invx2%, %invx2%, foods, 1, fast
- if ErrorLevel
- {
- FileAppend Out of food
- }
- else
- {
- ;msgbox, found color %i% at %Xc% and %Yc%
- FileAppend found food %foods% at %XFoodcolor% and %YFoodcolor%`n, *
- MoveMouse(XFoodcolor, YFoodcolor+Rand(5,10), 10)
- sleep, Rand(80,200)
- MouseClick Left
- Lookingfood :=False
- }
- }
- }
- }
- return
- PrayerStatus: ; Check Prayer Status
- newpleveltocheck:= 100py2
- GuiControlGet, ptext,, prayer
- newstatusp:=plvlnum
- plvlnum:=10
- PixelSearch, Xpstatus, Ypstatus, %100px1%, %100py1%, %100px2%, %100py2%, %pcolor%, 5, fast
- if ErrorLevel
- {
- Loop, 10 {
- newpleveltocheck:= newpleveltocheck+pdiff
- PixelSearch, Xcbtstatus, Ycbtstatus, %100px1%, %newpleveltocheck%, %100px2%, newpleveltocheck+3, %pcolor%, 1, fast
- if ErrorLevel
- {
- plvlnum--
- }
- else
- {
- plvlnum--
- break
- }
- }
- }
- else
- {
- newstatusp = 100`%
- }
- GuiControlGet, ptext,, health
- If (newstatusp != plvlnum)
- {
- newp:= plvlnum*10
- GuiControl,, prayer, %newp%`%
- }
- return
- GuiClose:
- ExitApp
Advertisement
Add Comment
Please, Sign In to add comment