Jump to content

Func help


BuddyBoy
 Share

Recommended Posts

Opt("GUIOnEventMode", 1)
Opt("MouseCoordMode", 0)
Opt("PixelCoordMode", 0)
#include <GUIConstants.au3>

HotKeySet("{F5}", "On")
HotKeySet("{F5}", "On1")
HotKeySet("{ESC}", "Terminate")

Dim $SearchMob=0
GUICreate("Test",150,100,100,100)
GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate")
$Lable=GUICtrlCreateCheckbox("Warrior/Trojan",10,5,130,15)
$Lable1=GUICtrlCreateCheckbox("Archer",10,35,130,15)
GUISetState()

While 1
    If $SearchMob Then Attack()
    Sleep(1000)
WEnd



Func On()
    $SearchMob=NOT $SearchMob
    If $SearchMob Then
        GUICtrlSetData($Lable,"F5 to turn off bot.")
    Else
        GUICtrlSetData($Lable,"F5 to turn on bot.")
    EndIf
EndFunc  

Func On1()
    $SearchMob=NOT $SearchMob
    If $SearchMob Then
        GUICtrlSetData($Lable1,"F5 to turn off bot.")
    Else
        GUICtrlSetData($Lable1,"F5 to turn on bot.")
    EndIf
EndFunc  

Func Jump()
    $x=Random(0,1024,1)
    $y=Random(0,690,1)
    MouseMove($x,$y,0)
    Send("{CTRLDOWN}")
    MouseClick("Left")
    Send("{CTRLUP}")
    Sleep(100)
EndFunc 

Func Attack()
    $Coords=PixelSearch(200,100,825,600,12059395,5)
    If NOT @error Then
        MouseClick("left",$Coords[0],$Coords[1]+20,1,0)
        Sleep(2500)
    Else
        Jump()
    EndIf
EndFunc

Func Terminate()
    Exit
EndFunc;==> Terminate()

Alright I almost got this figured out myself... Just stuck on one thing... I want the Warrior/Trojan checkbox to LEFT click (which I have) But for the archer, I want it to RIGHT click... How can I tell it to left click when Warrior/Trojan is started and how can I tell it also to Right click when Archer is started?

I created two On keys, is that right I hope...

Thanks for the help.

Link to comment
Share on other sites

Why won't anyone help me... I thought the rules here if I at least gave it my best effort, I could get some assistance :P I've tried everything, but I just can't get it ;)

Could I do something like this:

If GuiCtrlRead($Lable) = $GUI_CHECKED then
$left = Mouseclick('left', ....
EndIf

If GuiCtrlRead($Lable1) = $GUI_CHECKED then
$right = Mouseclick('right', ....
EndIf


Then down my clicks part I would do

[code]

Func Attack()
    $Coords=PixelSearch(200,100,825,600,12059395,5)
    If NOT @error Then
        MouseClick("$left, $right",$Coords[0],$Coords[1]+20,1,0); How could I do this part?
        Sleep(2500)
    Else
        Jump()
    EndIf
EndFunc

Idk if that would work... Would it?

Edited by BuddyBoy
Link to comment
Share on other sites

You would do something like this (not tested) in your Attack() function:

I think Piano Man means something like

Func Attack()
    $Coords=PixelSearch(200,100,825,600,12059395,5)
    If NOT @error Then
        If GuiCtrlRead($Lable) = $GUI_CHECKED then
            $left = Mouseclick('left',$Coords[0],$Coords[1]+20,1,0)
        EndIf
        If GuiCtrlRead($Lable1) = $GUI_CHECKED then
            $right = Mouseclick('right',$Coords[0],$Coords[1]+20,1,0)
        EndIf
        Sleep(2500)
    Else
        Jump()
    EndIf
EndFunc
Link to comment
Share on other sites

HotKeySet("{F5}", "On")
HotKeySet("{F5}", "On1")
HotKeySet("{ESC}", "Terminate")

Alright I almost got this figured out myself... Just stuck on one thing... I want the Warrior/Trojan checkbox to LEFT click (which I have) But for the archer, I want it to RIGHT click... How can I tell it to left click when Warrior/Trojan is started and how can I tell it also to Right click when Archer is started?

I created two On keys, is that right I hope...

Have you fixed this yet? You have both functions On() and On1() assigning to the same F5 key. That means only On1() is actually assigned.

:P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

First of all, I think you only can be Archer or Warrior (at a given time)

so you should use a radio button not checkboxes.

[function is GUICtrlCreateRadio]

Second, you should not bind a Key to two different functions, i mean you must use only one function.

Third, for your info message ("type F5 to start/stop"), i think you should use a label because you are overwriting

the text describing your checkboxes.

So, here it is :

Opt("GUIOnEventMode", 1)
Opt("MouseCoordMode", 0)
Opt("PixelCoordMode", 0)
#include <GUIConstants.au3>

HotKeySet("{F5}", "On")
HotKeySet("{ESC}", "Terminate")

Dim $SearchMob=0
GUICreate("Test",150,100,100,100)
GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate")

$Label=GUICtrlCreateLabel("F5 to turn on bot.",10,5,130,15)
$Radio1=GUICtrlCreateRadio("Warrior",10,35,130,15)
$Radio2=GUICtrlCreateRadio("Archer",10,65,130,15)
GUICtrlSetState ($Radio1, $GUI_CHECKED)
GUISetState()

While 1
    If $SearchMob Then Attack()
    Sleep(1000)
WEnd



Func On()
    $SearchMob=NOT $SearchMob
    If $SearchMob Then
        GUICtrlSetData($Label,"F5 to turn off bot.")
    Else
        GUICtrlSetData($Label,"F5 to turn on bot.")
    EndIf
EndFunc  


Func Jump()
    $x=Random(0,1024,1)
    $y=Random(0,690,1)
    MouseMove($x,$y,0)
    Send("{CTRLDOWN}")
    MouseClick("Left")
    Send("{CTRLUP}")
    Sleep(100)
EndFunc

Func Attack()
    $Coords=PixelSearch(200,100,825,600,12059395,5)
    If NOT @error Then
        if BitAND(GUICtrlRead($Radio1), $GUI_CHECKED) = $GUI_CHECKED then
        MouseClick("left",$Coords[0],$Coords[1]+20,1,0)
        Sleep(2500)
            else
        MouseClick("right",$Coords[0],$Coords[1]+20,1,0)
        Sleep(2500)
      endif
    Else
        Jump()
    EndIf
EndFunc

Func Terminate()
    Exit
EndFunc;==> Terminate()

Iklim

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...