Jump to content
Sign in to follow this  
Scorekeeper

Hp Pixel detector error.

Recommended Posts

I am very thankful for the help on my gather bot but need help on my hp/mp bot.

The bot will not run.

It is supposed to see if hp/mp on pixel x (bots percentage) goes below it.

If it goes below it then it will heal you with the set Fx button.

This is a lot to ask but if anyone can help with this i am grateful.

Heres the script.

;*********************************************|Variables Defined|*********************************************
$currentColor = 0
Dim $Width, $Height, $pixel, $Runbot, $hpbot, $mpbot, $Aboutbot, $aboutbot, $begin, $dif, $Channel3x, $Channel3y, $Runbot, $hpbot, $mpbot, $Screen, $hpbotpercent, $mpbotpercent
$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")
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 and %.", 20, 25, 180, 15)
$3 = GUICtrlCreateLabel ( "3. Select desired Mp Shotcut and %.", 20, 85, 180, 15)
$4 = GUICtrlCreateLabel ( "4. Select screen mode.", 20, 145, 110, 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 Copyright© 2005", 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)
;*********************************************|GUI|*********************************************

;*********************************************|settings|********************************************


*

$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")
$hpbotpercent = GUICtrlcreatecombo( "10%", 200, 50, 100)
GUICtrlSetData(-1,"20%")
GUICtrlSetData(-2,"30%")
GUICtrlSetData(-3,"40%")
GUICtrlSetData(-4,"50%")
GUICtrlSetData(-5,"60%")
GUICtrlSetData(-6,"70%")
GUICtrlSetData(-7,"80%")
$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")
$mpbotpercent = GUICtrlcreatecombo( "10%", 200, 110, 100)
GUICtrlSetData(-1,"20%")
GUICtrlSetData(-2,"30%")
GUICtrlSetData(-3,"40%")
GUICtrlSetData(-4,"50%")
GUICtrlSetData(-5,"60%")
GUICtrlSetData(-6,"70%")
GUICtrlSetData(-7,"80%")
$Screen = GUICtrlcreatecombo( "F1", 75, 110, 100)
GUICtrlSetData(-1,"F2")
GUICtrlSetData(-2,"F3")
GUICtrlSetData(-3,"F4")
GUICtrlSetData(-4,"F5")
GUICtrlSetData(-5,"F6")
GUICtrlSetData(-6,"F7")
;*********************************************|settings|********************************************


*
$Mode = GUICtrlcreatecombo( "Fullscreen", 75, 170, 100)
GUICtrlSetData(-1,"Windowed")
$Aboutbot = GUICtrlCreateButton ( "About", 115, 220, 75)
GUICtrlSetOnEvent($Aboutbot,"About")
$Runbot = GUICtrlCreateButton ( "Run bot", 20, 220, 75)
GUICtrlSetOnEvent($Runbot,"Runbot")
GUISetState(@SW_SHOW)
;*********************************************| GUI |*********************************************

;*********************************************|Run About |*********************************************
Func About()
Run ("C:\Program Files\RoseBots\Images\LS BOT.txt")
EndFunc
;*********************************************|Run About |*********************************************

;*********************************************|screen|*********************************************
Func OnChannel1()
    WinActivate("ROSE online")
    $Size = WinGetPos("ROSE online")
    $Width = $Size[2]
    $Height = $Size[3]
    If GUICtrlRead($Screen) = "Fullscreen" Then
        $Winx = 0
        $Winy = 0
    Else
        $Winx = 4
        $Winy = 30
        $Width = $Width - 8
        $Height = $Height - 34
    Endif
;*********************************************|screen|*********************************************

;*********************************************| pix hp |*********************************************
Func _hpbotpercent()
    Select
              Case GUICtrlRead($hpbotpercent) = "10%"
            ConsoleWrite(GUICtrlRead($hpbotpercent) & @LF)
           Send("86,75")
        Case GUICtrlRead($hpbotpercent) = "20%"
            ConsoleWrite(GUICtrlRead($hpbotpercent) & @LF)
         Send("99,75")      
        Case GUICtrlRead($hpbotpercent) = "30%"
            ConsoleWrite(GUICtrlRead($hpbotpercent) & @LF)
            Send("115,75")  
        Case GUICtrlRead($hpbotpercent) = "40%"
            ConsoleWrite(GUICtrlRead($hpbotpercent) & @LF)
            Send("124,75")
        Case GUICtrlRead($hpbotpercent) = "50%"
            ConsoleWrite(GUICtrlRead($hpbotpercent) & @LF)
            Send("160,75")
        Case GUICtrlRead($hpbotpercent) = "60%"
            ConsoleWrite(GUICtrlRead($hpbotpercent) & @LF)
           Send("171,75")
        Case GUICtrlRead($hpbotpercent) = "70%"
            ConsoleWrite(GUICtrlRead($hpbotpercent) & @LF)
            Send("184,75")  
        Case GUICtrlRead($hpbotpercent) = "80%"
            ConsoleWrite(GUICtrlRead($hpbotpercent) & @LF)
            Send("192,75")
    EndSelect
EndFunc
;*********************************************| pix hp |*********************************************

;*********************************************| pix mp |*********************************************
Func _hpbotpercent()
    Select
              Case GUICtrlRead($mpbotpercent) = "10%"
            ConsoleWrite(GUICtrlRead($mpbotpercent) & @LF)
         Send("86,88")
        Case GUICtrlRead($mpbotpercent) = "20%"
            ConsoleWrite(GUICtrlRead($mpbotpercent) & @LF)
         Send("99,88")      
        Case GUICtrlRead($mpbotpercent) = "30%"
            ConsoleWrite(GUICtrlRead($mpbotpercent) & @LF)
           Send("115,88")   
        Case GUICtrlRead($mpbotpercent) = "40%"
            ConsoleWrite(GUICtrlRead($mpbotpercent) & @LF)
           Send("124,88")
        Case GUICtrlRead($mpbotpercent) = "50%"
            ConsoleWrite(GUICtrlRead($mpbotpercent) & @LF)
            Send("160,88")
        Case GUICtrlRead($mpbotpercent) = "60%"
            ConsoleWrite(GUICtrlRead($mpbotpercent) & @LF)
           Send("171,88")
        Case GUICtrlRead($mpbotpercent) = "70%"
            ConsoleWrite(GUICtrlRead($mpbotpercent) & @LF)
            Send("184,88")  
        Case GUICtrlRead($mpbotpercent) = "80%"
            ConsoleWrite(GUICtrlRead($mpbotpercent) & @LF)
            Send("192,88")
    EndSelect
EndFunc

;*********************************************| pix mp |*********************************************

;*********************************************| Shortcut hp |*********************************************
Do
Until $pixel = 8468772
If $pixel = PixelGetColor(_hpbotpercent()) Then
;*********************************************| Shortcut hp |*********************************************  
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Send("{ESC}")
        Case    GUICtrlRead ($hpbot) = "F1"
            ConsoleWrite(GUICtrlRead($hpbot) & @LF)
            Send("{F1}")
        Case    GUICtrlRead ($hpbot) = "F2"
            ConsoleWrite(GUICtrlRead($hpbot) & @LF)
            Send("{F2}")
        Case    GUICtrlRead ($hpbot) = "F3"
            ConsoleWrite(GUICtrlRead($hpbot) & @LF)
            Send("{F3}")
        Case    GUICtrlRead ($hpbot) = "F4"
            ConsoleWrite(GUICtrlRead($hpbot) & @LF)
            Send("{F4}")
        Case    GUICtrlRead ($hpbot) = "F5"
            ConsoleWrite(GUICtrlRead($hpbot) & @LF)
            Send("{F5}")
        Case    GUICtrlRead ($hpbot) = "F6"
            ConsoleWrite(GUICtrlRead($hpbot) & @LF)
            Send("{F6}")
        Case    GUICtrlRead ($hpbot) = "F7"
            ConsoleWrite(GUICtrlRead($hpbot) & @LF)
            Send("{F7}")
        Case    GUICtrlRead ($hpbot) = "F8"
            ConsoleWrite(GUICtrlRead($hpbot) & @LF)
            Send("{F8}")
    EndSelect
WEnd
;*********************************************| Shortcut hp |*********************************************
Sleep (2500)

Do
Until $pixel = 3227248
If $pixel = PixelGetColor(_mpbotpercent()) Then
;*********************************************| Shortcut mp |*********************************************
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Send("{ESC}")
        Case    GUICtrlRead ($mpbot) = "F1"
            ConsoleWrite(GUICtrlRead($mpbot) & @LF)
            Send("{F1}")
        Case    GUICtrlRead ($mpbot) = "F2"
            ConsoleWrite(GUICtrlRead($mpbot) & @LF)
            Send("{F2}")
        Case    GUICtrlRead ($mpbot) = "F3"
            ConsoleWrite(GUICtrlRead($mpbot) & @LF)
            Send("{F3}")
        Case    GUICtrlRead ($mpbot) = "F4"
            ConsoleWrite(GUICtrlRead($mpbot) & @LF)
            Send("{F4}")
        Case    GUICtrlRead ($mpbot) = "F5"
            ConsoleWrite(GUICtrlRead($mpbot) & @LF)
            Send("{F5}")
        Case    GUICtrlRead ($mpbot) = "F6"
            ConsoleWrite(GUICtrlRead($mpbot) & @LF)
            Send("{F6}")
        Case    GUICtrlRead ($mpbot) = "F7"
            ConsoleWrite(GUICtrlRead($mpbot) & @LF)
            Send("{F7}")
        Case    GUICtrlRead ($mpbot) = "F8"
            ConsoleWrite(GUICtrlRead($mpbot) & @LF)
            Send("{F8}")
    EndSelect
WEnd

;*********************************************| Shortcut mp |*********************************************
Sleep (4000)
EndIf
EndIf

$begin = TimerInit()
do
$dif = TimerDiff($begin)
until $dif>7200000
Exit

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



Func Pause()
    $Paused = Not $Paused
    While $Paused
        Sleep(1)
        ToolTip(' Bot is "Paused"', 0, 0)
    WEnd
    ToolTip("")
EndFunc ;==>Pause

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

Func CLOSEClicked()
    Exit
EndFunc ;==>CLOSEClicked
Func EndScript()
    Exit
EndFunc

This is as far as my knowledge can go.

Thanks A LOT.

Edited by Scorekeeper

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

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...