Sign in to follow this  
Followers 0
SalazarCheats

search don't work

9 posts in this topic

#1 ·  Posted (edited)

can anyone help me, im making a program to search for a color. i have set the color and were it can search but it don't move the mouse or click anywere... can any one help...

here is my code:

CODE
#include <GUIConstants.au3>

GUICreate("Kalphite Worker killer---searching---") ; will create a dialog box that when displayed is centered

$text = GUICtrlCreateLabel("", 50,50,100,100)

GUISetState()

While 1

GUICtrlSetData($text, "Searching for Kalphite Worker\")

Sleep(200)

;optional just another look

;GUICtrlSetData($text, "-")

;sleep(200)

GUICtrlSetData($text, "Searching for Kalphite Worker/")

sleep(200)

GUICtrlSetData($text, "Searching for Kalphite Worker-")

sleep(200)

WEnd

Func power()

Exit

EndFunc

GUISetBkColor(0x00E0FFFF)

GUISetFont(9, 300)

GUISetState ()

HotKeySet("{ESC}", "power")

#include <Misc.au3>

#include <array.au3>

Global $on = 0

Global $coords

While 1

Sleep(50)

If $on = 1 Then

$coords = PixelSearch(10, 10, 640, 480, 0x5B605A, 20, 3)

If IsArray($coords) Then

MouseClick("Left", $coords[0], $coords[1], 1, 0)

EndIf

EndIf

Wend

Func _exit()

exit(0)

EndFunc

; Run the GUI until the dialog is closed

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

Wend

While 1

Sleep(10)

WEnd

also if some one could add a 'hotkeyset' for ctrl+s, to stop ans start it that would be help full.

Edited by SalazarCheats

Ok im 14 with a spelling age of a 9 year old... that explanes all my spelling mistakes

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

You are up for quite a challenge. I suggest you take a look at how most of the scripts are built. Includes on top, main in the middle, functions at the end. Remove any unused functions such as _Exit(). And remember you can have only 1 loop at once! Anything entered into ConsoleWrite can be read by SciTe, this is a useful tool to keep track of what is going on inside your script. Speaking of which, press Ctrl+T in SciTe to see what a script should look like. I have modified this in a way that it made sense to me, if this is not what you want then change it yourself.

#include <GUIConstants.au3>
#include <Misc.au3>
#include <array.au3>

GUICreate("Kalphite Worker killer---searching---") ; will create a dialog box that when displayed is centered
$text = GUICtrlCreateLabel("", 50, 50, 100, 100)

GUISetBkColor(0xE0FFFF)
GUISetFont(9, 300)
GUISetState()

Global $Paused
HotKeySet("^s", "TogglePause")
HotKeySet("{ESC}", "power")


Global $coords

While 1
    $coords = PixelSearch(10, 10, 640, 480, 0x5B605A, 20, 3)
    If IsArray($coords) Then
        MouseClick("Left", $coords[0], $coords[1], 1, 0)
        ConsoleWrite("Worker found, clicking" & @CRLF)
    Else
        ConsoleWrite("Worker not found" & @CRLF)
    EndIf
    If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop
    Sleep(50)
WEnd

; Run the GUI until the dialog is closed
While 1
    If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop
    Sleep(50)
WEnd

Func power()
    Exit
EndFunc   ;==>power

Func TogglePause()
    $Paused = Not $Paused
    While $Paused
        Sleep(100)
    WEnd
EndFunc   ;==>TogglePause
Edited by Manadar

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

this doesnt work forr a game called runescape

i need to to fight kjelphite woirkers but it attaks one and then another... so i cgat killed... is there anyway for it to stop fighting untill that monster has died...

I dont know if this will help... when u hurt a monster a red icon pops up over part of a body... ambey you could automaticls pause it untill that monster has died..., the only problems is that you dont allways hurt them...

Please help me:

EDIT: also it dont search to just clicks in one place,

Edited by SalazarCheats

Ok im 14 with a spelling age of a 9 year old... that explanes all my spelling mistakes

Share this post


Link to post
Share on other sites

It's quite easy to do that really. Measure the time it takes to kill a monster, in the worst case, then add 20% to that time (to make sure the monster really is dead ) and put that time into a Sleep(x) behind MouseClick.. :whistle:

This should get you well under way,

Manadar.

Share this post


Link to post
Share on other sites

ok thanks ive done that... but it still dont search for a monester if just dont click at all...

Is it because of the mouse click(but i dont get that cus it dont search) can you please rewirte my code to do it:

Here is my code:

CODE
#include <GUIConstants.au3>

#include <Misc.au3>

#include <array.au3>

GUICreate("Kalphite Worker killer---searching---") ; will create a dialog box that when displayed is centered

$text = GUICtrlCreateLabel("", 50, 50, 100, 100)

GUISetBkColor(0xE0FFFF)

GUISetFont(9, 300)

GUISetState()

Global $Paused

HotKeySet("^s", "TogglePause")

HotKeySet("{ESC}", "power")

Global $coords

While 1

$coords = PixelSearch(10, 10, 640, 480, 0x5B605A, 20, 3)

If IsArray($coords) Then

MouseClick("Left")

Sleep(20000)

ConsoleWrite("Worker found, clicking" & @CRLF)

Else

ConsoleWrite("Worker not found" & @CRLF)

EndIf

If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop

Sleep(50)

WEnd

; Run the GUI until the dialog is closed

While 1

If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop

Sleep(50)

WEnd

Func power()

Exit

EndFunc ;==>power

Func TogglePause()

$Paused = Not $Paused

While $Paused

Sleep(100)

WEnd

EndFunc ;==>TogglePause

thanks for doing thisa for me


Ok im 14 with a spelling age of a 9 year old... that explanes all my spelling mistakes

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

It's quite easy to do that really. Measure the time it takes to kill a monster, in the worst case, then add 20% to that time (to make sure the monster really is dead ) and put that time into a Sleep(x) behind MouseClick.. :whistle:

This should get you well under way,

Manadar.

An easier way might be to have it check the health bar for the monster. Then, if the health bar is empty, it will stop.

Edited by BALA

[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com

Share this post


Link to post
Share on other sites

yes tehre r helath bars can if stop when a helath bar comes on and then start again when it disspeares


Ok im 14 with a spelling age of a 9 year old... that explanes all my spelling mistakes

Share this post


Link to post
Share on other sites

yes tehre r helath bars can if stop when a helath bar comes on and then start again when it disspeares

I suppose what you would do is search for the right color pixel for the health bar,and that would trigger the fight fuction. Then check to see if it disappears, and that will stop the fight function


[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com

Share this post


Link to post
Share on other sites

i dont know how to use these codes :shocked: can you PLEASE tell me how to start them??i have previous codes made by some of you but i can use them :(:P

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  
Followers 0