Jump to content

Recommended Posts

Posted

Well i have started to make my hp/mp bot.

This is the code for it.

Questions are at the bottom.

HotKeySet("{ESC}", "End")
    WinActivate("ROSE online")
    
;*********************************************| Resolution 800x600  |*********************************************
Func hpmp800600()
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 2374017 
If $pixel = PixelGetColor(88,42) Then
$variable = GuiCtrlCreateInput("{f2}", 15, 15, 70, 20)
Sleep (2500)
EndIf
EndIf
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 7355953 
If $pixel = PixelGetColor(87,58) Then
$variable = GuiCtrlCreateInput("{f3}", 15, 15, 70, 20)
Sleep (4000)
EndIf
EndIf
EndFunc
$loop = 999999
;*********************************************| Resolution 800x600  |*********************************************

;*********************************************| Resolution 1024x768 |*********************************************
Func hpmp1024768()
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 2374017 
If $pixel = PixelGetColor(85,43) Then
$variable = GuiCtrlCreateInput("{f2}", 15, 15, 70, 20)
Sleep (2500)
EndIf
EndIf
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 7355953 
If $pixel = PixelGetColor(87,56) Then
$variable = GuiCtrlCreateInput("{f3}", 15, 15, 70, 20)
Sleep (4000)
EndIf
EndIf
EndFunc
$loop = 999999
;*********************************************| Resolution 1024x768 |*********************************************

;*********************************************| Resolution 1152x864 |*********************************************
Func hpmp1152864()
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 2374017 
If $pixel = PixelGetColor(85,42) Then
$variable = GuiCtrlCreateInput("{f2}", 15, 15, 70, 20)
Sleep (2500)
EndIf
EndIf
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 7355953 
If $pixel = PixelGetColor(85,57) Then
$variable = GuiCtrlCreateInput("{f3}", 15, 15, 70, 20)
Sleep (4000)
EndIf
EndIf
EndFunc
$loop = 999999
;*********************************************| Resolution 1152x864 |*********************************************

;*********************************************| Resolution 1280x768 |*********************************************
Func hpmp1280768()
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 2374017 
If $pixel = PixelGetColor(83,42) Then
$variable = GuiCtrlCreateInput("{f2}", 15, 15, 70, 20)
Sleep (2500)
EndIf
EndIf
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 7355953 
If $pixel = PixelGetColor(86,57) Then
$variable = GuiCtrlCreateInput("{f3}", 15, 15, 70, 20)
Sleep (4000)
EndIf
EndIf
EndFunc
$loop = 999999
;*********************************************| Resolution 1280x768 |*********************************************

;*********************************************| Resolution 1280x960 |*********************************************  
Func hpmp1280960()
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 2374017 
If $pixel = PixelGetColor(91,43) Then
$variable = GuiCtrlCreateInput("{f2}", 15, 15, 70, 20)
EndIf
EndIf
Sleep (2500)
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 7355953 
If $pixel = PixelGetColor(88,56) Then
$variable = GuiCtrlCreateInput("{f3}", 15, 15, 70, 20)
Sleep (4000)
EndIf
EndIf
EndFunc
$loop = 999999
;*********************************************| Resolution 1280x960 |*********************************************

;*********************************************| Resolution 1280x1024 |********************************************* 
Func hpmp12801024()
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 2374017 
If $pixel = PixelGetColor(85,42) Then
$variable = GuiCtrlCreateInput("{f2}", 15, 15, 70, 20)
Sleep (2500)
EndIf
EndIf
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 7355953 
If $pixel = PixelGetColor(85,55) Then
$variable = GuiCtrlCreateInput("{f3}", 15, 15, 70, 20)
Sleep (4000)
EndIf
EndIf
EndFunc
$loop = 999999
;*********************************************| Resolution 1280x1024 |********************************************* 




Func End()
    Exit
    EndFunc

This is just the start of the bot when finished it will have a gui as well.

1) The problem is that it will not repeat.

2) I was also wondering if i could see the code you use to create the input command box for F1,F2, F3 plz as it would help.

3) Any other ways to fix the bot would help a LOT.

This is only half of my bot which i have made in about a hour so bear with me.

Thanks if you can help me finish this stage.

Fou-Lu - Bof4 "...Wouldst thou fight a god?"
Posted

I have edited the script to:

HotKeySet("{ESC}", "End")
    WinActivate("ROSE online")
    
    
Dim $Width, $Height, $pixel, $Counter, $variable    
;*********************************************| Resolution 800x600  |*********************************************
Func hpmp800600()
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 2374017 
If $pixel = PixelGetColor(88,42) Then
$variable = GuiCtrlCreateInput("{F2}", 15, 15, 70, 20)
Sleep (2500)
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 7355953 
If $pixel = PixelGetColor(87,58) Then
$variable = GuiCtrlCreateInput("{F3}", 15, 15, 70, 20)
Sleep (4000)
EndIf
EndIf
EndIf
EndIf
EndFunc
;*********************************************| Resolution 800x600  |*********************************************

;*********************************************| Resolution 1024x768 |*********************************************
Func hpmp1024768()
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 2374017 
If $pixel = PixelGetColor(85,43) Then
$variable = GuiCtrlCreateInput("{F2}", 15, 15, 70, 20)
Sleep (2500)
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 7355953 
If $pixel = PixelGetColor(87,56) Then
$variable = GuiCtrlCreateInput("{F3}", 15, 15, 70, 20)
Sleep (4000)
EndIf
EndIf
EndIf
EndIf
EndFunc
;*********************************************| Resolution 1024x768 |*********************************************

;*********************************************| Resolution 1152x864 |*********************************************
Func hpmp1152864()
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 2374017 
If $pixel = PixelGetColor(85,42) Then
$variable = GuiCtrlCreateInput("{F2}", 15, 15, 70, 20)
Sleep (2500)
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 7355953 
If $pixel = PixelGetColor(85,57) Then
$variable = GuiCtrlCreateInput("{F3}", 15, 15, 70, 20)
Sleep (4000)
EndIf
EndIf
EndIf
EndIf
EndFunc
;*********************************************| Resolution 1152x864 |*********************************************

;*********************************************| Resolution 1280x768 |*********************************************
Func hpmp1280768()
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 2374017 
If $pixel = PixelGetColor(83,42) Then
$variable = GuiCtrlCreateInput("{F2}", 15, 15, 70, 20)
Sleep (2500)
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 7355953 
If $pixel = PixelGetColor(86,57) Then
$variable = GuiCtrlCreateInput("{F3}", 15, 15, 70, 20)
Sleep (4000)
EndIf
EndIf
EndIf
EndIf
EndFunc
;*********************************************| Resolution 1280x768 |*********************************************

;*********************************************| Resolution 1280x960 |*********************************************  
Func hpmp1280960()
If $Width = 1280 AND $Height = 960 Then
Do 
Until $pixel = 2374017 
If $pixel = PixelGetColor(91,43) Then
$variable = GuiCtrlCreateInput("{F2}", 15, 15, 70, 20)
Sleep (2500)
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 7355953 
If $pixel = PixelGetColor(88,56) Then
$variable = GuiCtrlCreateInput("{F3}", 15, 15, 70, 20)
Sleep (4000)
EndIf
EndIf
EndIf
EndIf
EndFunc
;*********************************************| Resolution 1280x960 |*********************************************

;*********************************************| Resolution 1280x1024 |********************************************* 
Func hpmp12801024()
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 2374017 
If $pixel = PixelGetColor(85,42) Then
$variable = GuiCtrlCreateInput("{F2}", 15, 15, 70, 20)
Sleep (2500)
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 7355953 
If $pixel = PixelGetColor(85,55) Then
$variable = GuiCtrlCreateInput("{F3}", 15, 15, 70, 20)
Sleep (4000)
EndIf
EndIf
EndIf
EndIf
EndFunc
;*********************************************| Resolution 1280x1024 |********************************************* 



Func End()
    Exit
    EndFunc

But

1) The problem is that it will not repeat.

2) I was also wondering if i could see the code you use to create the input command box for F1,F2, F3 plz as it would help.

I know it might be easy for you but i have look around and still don not know what to do.

Plz help.

Fou-Lu - Bof4 "...Wouldst thou fight a god?"
Posted

what is rose online?? whats the url?.. its hard to test this script to see the problem, when we dont know what your trying to do.

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Posted

rose online is a online game at www.roseon.com

I am trying to make a hp/mp bot.

1)first you can select a command f1,f2,f3 for a box for hp and same for mp.

2)Then dectect the resolution of the game.

3)Then always use that script under the resolution until exit.

Fou-Lu - Bof4 "...Wouldst thou fight a god?"
  • Moderators
Posted

Func hpmp12801024()
While 1
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 2374017
If $pixel = PixelGetColor(85,42) Then
$variable = GuiCtrlCreateInput("{F2}", 15, 15, 70, 20)
Sleep (2500)
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 7355953
If $pixel = PixelGetColor(85,55) Then
$variable = GuiCtrlCreateInput("{F3}", 15, 15, 70, 20)
Sleep (4000)
EndIf
EndIf
EndIf
EndIf
hpmp12801024()
Sleep(100)
Wend
EndFunc

Shot in the dark, hope it helps. Don't know what you mean by the F's. Are you trying to do a Send("{F3}")? $F3 = Send("{F3}") GuiCtrlCreateInput($F3, 15, 15, 70, 20)?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Posted (edited)

Here is my new script.

There is the problem that the bot does not press the button f2,f3 etc at all.

What is wrong.

;*********************************************|Variables Defined|*********************************************    
Dim $Width, $Height, $pixel, $Counter, $variable,$Cancelx, $Cancely, $Casiox, $Casioy, $pixelColor, $Sleep1, $Sleep2, $Channel1x, $Channel1y, $Channel2x, $Channel2y, $Channel3x, $Channel3y,$Runbot,$hpbot,$mpbot
$currentColor = 0
$count = 0    
;*********************************************|Variables Defined|*********************************************

;*********************************************|GUI|*********************************************
    #include <GUIConstants.au3>
Fileinstall("C:\Program Files\RoseBots\Images\Background.jpg","C:\Program Files\RoseBots\Images\Background.jpg")
Fileinstall("C:\Program Files\RoseBots\Images\LS.bmp","C:\Program Files\RoseBots\Images\LS.bmp")
Global $Paused
HotKeySet("{ESC}", "EndScript")
HotKeySet("{PAUSE}", "pause")
Opt("GUIOnEventMode",1)
GUICreate ( "Life Support Bot By ScoreKeeper", 400,335)
GUISetBKcolor(6119597)
GUICtrlCreatePic("C:\Program Files\RoseBots\Images\Background.jpg",0,0,400,335,$WS_EX_TRANSPARENT) 
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
$1 = GUICtrlCreateLabel ( "1. Login to ROSE and Alt-Tab back here", 20, 10, 195, 15)
$2 = GUICtrlCreateLabel ( "2. Select desired Hp Shotcut", 20, 25, 140, 15)
$3 = GUICtrlCreateLabel ( "3. Select desired Mp Shotcut", 20, 85, 140, 15)
$4 = GUICtrlCreateLabel ( "4. Alt-Tab bact into rose Online.", 20, 145, 165, 15)
$6 = GUICtrlCreateLabel ( "The Esc button will exit the script.", 20, 250, 160, 15)
$7 = GUICtrlCreateLabel ( "The Pause button will pause the script.", 20, 265, 185, 15)
$8 = GUICtrlCreateLabel ( "Life Support Bot by ScoreKeeper AKA Darren Willows !", 20, 295, 270, 15)
$9 = GUICtrlCreateLabel ( "www.GamerzPlanet.net", 20, 310, 200, 15)
GUICtrlSetColor($1,16768341)
GUICtrlSetColor($2,16768341)
GUICtrlSetColor($3,16768341)
GUICtrlSetColor($4,16768341)
GUICtrlSetColor($6,16768341)
GUICtrlSetColor($7,16768341)
GUICtrlSetColor($8,16768341)
GUICtrlSetColor($9,16768341)
GUICtrlCreatePic("C:\Program Files\RoseBots\Images\LS.bmp",315,250,85,85,0,$WS_EX_STATICEDGE)
$hpbot = GUICtrlcreatecombo( "F1", 75, 50, 100)
GUICtrlSetData(-1,"F2")
GUICtrlSetData(-2,"F3")
GUICtrlSetData(-3,"F4")
GUICtrlSetData(-4,"F5")
GUICtrlSetData(-5,"F6")
GUICtrlSetData(-6,"F7")
GUICtrlSetData(-7,"F8")
$mpbot = GUICtrlcreatecombo( "F1", 75, 110, 100)
GUICtrlSetData(-1,"F2")
GUICtrlSetData(-2,"F3")
GUICtrlSetData(-3,"F4")
GUICtrlSetData(-4,"F5")
GUICtrlSetData(-5,"F6")
GUICtrlSetData(-6,"F7")
GUICtrlSetData(-7,"F8")

$Runbot = GUICtrlCreateButton ( "Run bot", 20, 180, 75)
GUICtrlSetOnEvent($Runbot,"Runbot")

GUISetState(@SW_SHOW)
;*********************************************| GUI |*********************************************

;*********************************************|Process|*********************************************



While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then Send("{ESC}")
    Wend
    
Func Pause()
    $Paused = NOT $Paused
    While $Paused
        sleep(1)
        ToolTip('Life Support Bot is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc
;*********************************************| Process |*********************************************

;*********************************************| Run Process |*********************************************
Func Runbot()
    WinActivate("ROSE online")
    $Size = WinGetPos("ROSE online")
        $Width = $Size[2]
    $Height = $Size[3]
    EndFunc
;*********************************************|Run Process|*********************************************

;*********************************************| Resolution 800x600  |*********************************************
Func hpmp800600()
If $Width = 1280 AND $Height = 960 Then
Do 
Until $pixel = 2374017 
If $pixel = PixelGetColor(88,42) Then
;*********************************************| Shortcut hp |*********************************************
If GUICtrlRead($hpbot) = "F1" Then
Send("{F1}")    
EndIf
If GUICtrlRead($hpbot) = "F2" Then
Send("{F2}")    
EndIf
If GUICtrlRead($hpbot) = "F3" Then
Send("{F3}")    
EndIf
If GUICtrlRead($hpbot) = "F4" Then
Send("{F4}")    
EndIf
If GUICtrlRead($hpbot) = "F5" Then
Send("{F5}")    
EndIf
If GUICtrlRead($hpbot) = "F6" Then
Send("{F6}")    
EndIf
If GUICtrlRead($hpbot) = "F7" Then
Send("{F7}")    
EndIf
If GUICtrlRead($hpbot) = "F8" Then
Send("{F8}")    
EndIf 
;*********************************************| Shortcut hp |*********************************************
Sleep (2500)
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 7355953 
If $pixel = PixelGetColor(87,58) Then
;*********************************************| Shortcut mp |*********************************************
If GUICtrlRead($mpbot) = "F1" Then
Send("{F1}")    
EndIf
If GUICtrlRead($mpbot) = "F2" Then
Send("{F2}")    
EndIf
If GUICtrlRead($mpbot) = "F3" Then
Send("{F3}")    
EndIf
If GUICtrlRead($mpbot) = "F4" Then
Send("{F4}")    
EndIf
If GUICtrlRead($mpbot) = "F5" Then
Send("{F5}")    
EndIf
If GUICtrlRead($mpbot) = "F6" Then
Send("{F6}")    
EndIf
If GUICtrlRead($mpbot) = "F7" Then
Send("{F7}")    
EndIf 
If GUICtrlRead($mpbot) = "F8" Then
Send("{F8}")    
EndIf 
;*********************************************| Shortcut mp |*********************************************
Sleep (4000)
EndIf
EndIf
EndIf
EndIf
EndFunc
;*********************************************| Resolution 800x600  |*********************************************

;*********************************************| Resolution 1024x768 |*********************************************
Func hpmp1024768()
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 2374017 
If $pixel = PixelGetColor(85,43) Then
;*********************************************| Shortcut hp |*********************************************
If GUICtrlRead($hpbot) = "F1" Then
Send("{F1}")    
EndIf
If GUICtrlRead($hpbot) = "F2" Then
Send("{F2}")    
EndIf
If GUICtrlRead($hpbot) = "F3" Then
Send("{F3}")    
EndIf
If GUICtrlRead($hpbot) = "F4" Then
Send("{F4}")    
EndIf
If GUICtrlRead($hpbot) = "F5" Then
Send("{F5}")    
EndIf
If GUICtrlRead($hpbot) = "F6" Then
Send("{F6}")    
EndIf
If GUICtrlRead($hpbot) = "F7" Then
Send("{F7}")    
EndIf
If GUICtrlRead($hpbot) = "F8" Then
Send("{F8}")    
EndIf 
;*********************************************| Shortcut hp |*********************************************
Sleep (2500)
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 7355953 
If $pixel = PixelGetColor(87,56) Then
;*********************************************| Shortcut mp |*********************************************
If GUICtrlRead($mpbot) = "F1" Then
Send("{F1}")    
EndIf
If GUICtrlRead($mpbot) = "F2" Then
Send("{F2}")    
EndIf
If GUICtrlRead($mpbot) = "F3" Then
Send("{F3}")    
EndIf
If GUICtrlRead($mpbot) = "F4" Then
Send("{F4}")    
EndIf
If GUICtrlRead($mpbot) = "F5" Then
Send("{F5}")    
EndIf
If GUICtrlRead($mpbot) = "F6" Then
Send("{F6}")    
EndIf
If GUICtrlRead($mpbot) = "F7" Then
Send("{F7}")    
EndIf 
If GUICtrlRead($mpbot) = "F8" Then
Send("{F8}")    
EndIf 
;*********************************************| Shortcut mp |*********************************************
Sleep (4000)
EndIf
EndIf
EndIf
EndIf
EndFunc
;*********************************************| Resolution 1024x768 |*********************************************

;*********************************************| Resolution 1152x864 |*********************************************
Func hpmp1152864()
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 2374017 
If $pixel = PixelGetColor(85,42) Then
;*********************************************| Shortcut hp |*********************************************
If GUICtrlRead($hpbot) = "F1" Then
Send("{F1}")    
EndIf
If GUICtrlRead($hpbot) = "F2" Then
Send("{F2}")    
EndIf
If GUICtrlRead($hpbot) = "F3" Then
Send("{F3}")    
EndIf
If GUICtrlRead($hpbot) = "F4" Then
Send("{F4}")    
EndIf
If GUICtrlRead($hpbot) = "F5" Then
Send("{F5}")    
EndIf
If GUICtrlRead($hpbot) = "F6" Then
Send("{F6}")    
EndIf
If GUICtrlRead($hpbot) = "F7" Then
Send("{F7}")    
EndIf
If GUICtrlRead($hpbot) = "F8" Then
Send("{F8}")    
EndIf 
;*********************************************| Shortcut hp |*********************************************
Sleep (2500)
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 7355953 
If $pixel = PixelGetColor(85,57) Then
;*********************************************| Shortcut mp |*********************************************
If GUICtrlRead($mpbot) = "F1" Then
Send("{F1}")    
EndIf
If GUICtrlRead($mpbot) = "F2" Then
Send("{F2}")    
EndIf
If GUICtrlRead($mpbot) = "F3" Then
Send("{F3}")    
EndIf
If GUICtrlRead($mpbot) = "F4" Then
Send("{F4}")    
EndIf
If GUICtrlRead($mpbot) = "F5" Then
Send("{F5}")    
EndIf
If GUICtrlRead($mpbot) = "F6" Then
Send("{F6}")    
EndIf
If GUICtrlRead($mpbot) = "F7" Then
Send("{F7}")    
EndIf 
If GUICtrlRead($mpbot) = "F8" Then
Send("{F8}")    
EndIf 
;*********************************************| Shortcut mp |*********************************************
Sleep (4000)
EndIf
EndIf
EndIf
EndIf
EndFunc
;*********************************************| Resolution 1152x864 |*********************************************

;*********************************************| Resolution 1280x768 |*********************************************
Func hpmp1280768()
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 2374017 
If $pixel = PixelGetColor(83,42) Then
;*********************************************| Shortcut hp |*********************************************
If GUICtrlRead($hpbot) = "F1" Then
Send("{F1}")    
EndIf
If GUICtrlRead($hpbot) = "F2" Then
Send("{F2}")    
EndIf
If GUICtrlRead($hpbot) = "F3" Then
Send("{F3}")    
EndIf
If GUICtrlRead($hpbot) = "F4" Then
Send("{F4}")    
EndIf
If GUICtrlRead($hpbot) = "F5" Then
Send("{F5}")    
EndIf
If GUICtrlRead($hpbot) = "F6" Then
Send("{F6}")    
EndIf
If GUICtrlRead($hpbot) = "F7" Then
Send("{F7}")    
EndIf
If GUICtrlRead($hpbot) = "F8" Then
Send("{F8}")    
EndIf 
;*********************************************| Shortcut hp |*********************************************
Sleep (2500)
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 7355953 
If $pixel = PixelGetColor(86,57) Then
;*********************************************| Shortcut mp |*********************************************
If GUICtrlRead($mpbot) = "F1" Then
Send("{F1}")    
EndIf
If GUICtrlRead($mpbot) = "F2" Then
Send("{F2}")    
EndIf
If GUICtrlRead($mpbot) = "F3" Then
Send("{F3}")    
EndIf
If GUICtrlRead($mpbot) = "F4" Then
Send("{F4}")    
EndIf
If GUICtrlRead($mpbot) = "F5" Then
Send("{F5}")    
EndIf
If GUICtrlRead($mpbot) = "F6" Then
Send("{F6}")    
EndIf
If GUICtrlRead($mpbot) = "F7" Then
Send("{F7}")    
EndIf 
If GUICtrlRead($mpbot) = "F8" Then
Send("{F8}")    
EndIf 
;*********************************************| Shortcut mp |*********************************************
Sleep (4000)
EndIf
EndIf
EndIf
EndIf
EndFunc
;*********************************************| Resolution 1280x768 |*********************************************

;*********************************************| Resolution 1280x960 |*********************************************    
Func hpmp1280960()
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 2374017 
If $pixel = PixelGetColor(91,43) Then
;*********************************************| Shortcut hp |*********************************************
If GUICtrlRead($hpbot) = "F1" Then
Send("{F1}")    
EndIf
If GUICtrlRead($hpbot) = "F2" Then
Send("{F2}")    
EndIf
If GUICtrlRead($hpbot) = "F3" Then
Send("{F3}")    
EndIf
If GUICtrlRead($hpbot) = "F4" Then
Send("{F4}")    
EndIf
If GUICtrlRead($hpbot) = "F5" Then
Send("{F5}")    
EndIf
If GUICtrlRead($hpbot) = "F6" Then
Send("{F6}")    
EndIf
If GUICtrlRead($hpbot) = "F7" Then
Send("{F7}")    
EndIf
If GUICtrlRead($hpbot) = "F8" Then
Send("{F8}")    
EndIf 
;*********************************************| Shortcut hp |*********************************************
Sleep (2500)
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 7355953 
If $pixel = PixelGetColor(88,56) Then
;*********************************************| Shortcut mp |*********************************************
If GUICtrlRead($mpbot) = "F1" Then
Send("{F1}")    
EndIf
If GUICtrlRead($mpbot) = "F2" Then
Send("{F2}")    
EndIf
If GUICtrlRead($mpbot) = "F3" Then
Send("{F3}")    
EndIf
If GUICtrlRead($mpbot) = "F4" Then
Send("{F4}")    
EndIf
If GUICtrlRead($mpbot) = "F5" Then
Send("{F5}")    
EndIf
If GUICtrlRead($mpbot) = "F6" Then
Send("{F6}")    
EndIf
If GUICtrlRead($mpbot) = "F7" Then
Send("{F7}")    
EndIf 
If GUICtrlRead($mpbot) = "F8" Then
Send("{F8}")    
EndIf 
;*********************************************| Shortcut mp |*********************************************
Sleep (4000)
EndIf
EndIf
EndIf
EndIf
EndFunc
;*********************************************| Resolution 1280x960 |*********************************************

;*********************************************| Resolution 1280x1024 |*********************************************    
Func hpmp12801024()
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 2374017 
If $pixel = PixelGetColor(85,42) Then
;*********************************************| Shortcut hp |*********************************************
If GUICtrlRead($hpbot) = "F1" Then
Send("{F1}")    
EndIf
If GUICtrlRead($hpbot) = "F2" Then
Send("{F2}")    
EndIf
If GUICtrlRead($hpbot) = "F3" Then
Send("{F3}")    
EndIf
If GUICtrlRead($hpbot) = "F4" Then
Send("{F4}")    
EndIf
If GUICtrlRead($hpbot) = "F5" Then
Send("{F5}")    
EndIf
If GUICtrlRead($hpbot) = "F6" Then
Send("{F6}")    
EndIf
If GUICtrlRead($hpbot) = "F7" Then
Send("{F7}")    
EndIf
If GUICtrlRead($hpbot) = "F8" Then
Send("{F8}")    
EndIf 
;*********************************************| Shortcut hp |*********************************************)
Sleep (2500)
If $Width = 1280 AND $Height = 960 Then
Do
Until $pixel = 7355953 
If $pixel = PixelGetColor(85,55) Then
;*********************************************| Shortcut mp |*********************************************
If GUICtrlRead($mpbot) = "F1" Then
Send("{F1}")    
EndIf
If GUICtrlRead($mpbot) = "F2" Then
Send("{F2}")    
EndIf
If GUICtrlRead($mpbot) = "F3" Then
Send("{F3}")    
EndIf
If GUICtrlRead($mpbot) = "F4" Then
Send("{F4}")    
EndIf
If GUICtrlRead($mpbot) = "F5" Then
Send("{F5}")    
EndIf
If GUICtrlRead($mpbot) = "F6" Then
Send("{F6}")    
EndIf
If GUICtrlRead($mpbot) = "F7" Then
Send("{F7}")    
EndIf 
If GUICtrlRead($mpbot) = "F8" Then
Send("{F8}")    
EndIf 
;*********************************************| Shortcut mp |*********************************************
Sleep (4000)
EndIf
EndIf
EndIf
EndIf
EndFunc
;*********************************************| Resolution 1280x1024 |*********************************************    

;*********************************************| Closing |*********************************************
Func CLOSEClicked()
exit
EndFunc
Func EndScript()
Exit
EndFunc

Sorry its sooooo long.

Help is REALLY APRECIATED.

Edited by Scorekeeper
Fou-Lu - Bof4 "...Wouldst thou fight a god?"
Posted (edited)

I find that if you clean up your code and make it more efficient, you'll see that you can spot errors more easily and it makes debugging that much faster.

Having said that, when the button is pressed, have the key values stored in one variable. For example, when they start the bot, $HPKEY and $MPKEY would be set....

sample:

---------

Select
   Case $Width = 800 AND $Height = 600
      $x1=88
      $y1=42
      $x2=87
      $y2=56
   Case $Width = 1024 AND $Height = 768
      $x1=85
      $y1=43
      $x2=87
      $y2=56
   Case $Width = 1152 AND $Height = 864
      $x1=85
      $y1=42
      $x2=85
      $y2=57
   Case $Width = 1280 AND $Height = 768
      $x1=83
      $y1=42
      $x2=86
      $y2=57
   Case $Width = 1280 AND $Height = 960
      $x1=91
      $y1=43
      $x2=88
      $y2=56
   Case $Width = 1280 AND $Height = 1024
      $x1=85
      $y1=42
      $x2=85
      $y2=55
EndSelect

While 1;<== Main
    $msg = GUIGetMsg()
   
    Select
      Case $msg = $startbutton;if user clicks on start
        $HPKEY = GUICtrlRead ($hpbot);key is read into a variable(f1-f8)
        $MPKEY = GUICtrlRead ($mpbot);key read into a variable(f1-f8)
        $keysend_health = ' "{ ' & $HKEY & ' }" '  ;key is converted to "{KEY}" format
        $keysend_mana = ' "{ ' & $MKEY & ' }" '  ;key is converted to "{KEY}" format
        HPMP ($keysend_health, $keysend_mana, $pixel, $x1, $y1, $x2, $y2);==> bot start function
      Case $msg = $GUI_EVENT_CLOSE
        exit
    EndSelect 
 
Wend ;<==End of Main

;-----This goes right after the Start Process Part, where resolution starts -----

func HPMP ($hp, $mp, $pixel, $x1, $y1, $x2, $y2);<==start of bot start function
while 1;continue forever
      If PixelGetColor($x1,$y1) = $pixel then  ;(switched order around to make it flow better)
         Send ($hp)
         Sleep (2500)
      EndIf
      If PixelGetColor($x2,$y2) = $pixel Then  ;(see above)
         Send ($mp)
         Sleep (4000)
      EndIf
WEnd
endfunc ;<== End of start bot function

It's safe to say that whenever you are repeating the same lines of code multiple times you are doing unnecessary work which could be done in a fraction of the lines. After looknig at your code, I see that from resolution to resolution, the only lines of code that are changing are the coordinates. You can easily clean up the bot by doing the above.... compare the amount of lines of my code and yours ;P see how easy that was...

Few things to note:

*When passing variable to functions, the variables can be renamed within that function.. ie. i call a function with Function () and for sake of argument i send it the variables $Apple and $Bannana. ==> function ($apple, $bannana). When the function recieves these variables, it can rename them: Func function ($a, $:( and within that function, the apple variable will be known as $a and so on..

*The select/Endselect and Case are part of the Select Loop. Im sure it was easy to figure out how it works but u can refer to the helpfile if youre having trouble (you could just as easily use a if/elseif loop but in this case a Select loop works a bit better.

*In your code, for each resolution, you forgot to change the if statements, they all read: "If $width = 1024 and $height = 960" .. thats probably why you bot didnt work

Edited by ame1011
[font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font]

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...