Sign in to follow this  
Followers 0
zetterberg

ImageSearch help " bot "

3 posts in this topic

#1 ·  Posted (edited)

Hello, I need help with these codes, To a bot. The bot is for "Impulse.nu" so I can press and get level whitout pressing any button or use the mouse, but when I try to do so the Serch for pictures it wont work so please help me, I put the codes here and hope somone can make it right for me. The script work but only one part of the script is wrong or something.

Here you have the codes, This part dont work when i run the hole script.

So if somone can do so it Search for a image and then click on it ( The broken part )

Func finkan()

While $finkan = 1 ; Finkan

$finkan = _imagesearch("Bild.bmp",0,$x2,$y2,255)

if $finkan = 1 Then

MouseMove($x2,$y2,20)

Endfunc

EndIf

All the codes have you here.

;impulse.nu bot Programerad
;Först av allt, fyll på energin och HP, sedan gå till impulse rutan! (logga in innan du öppnar detta program)

;För att sluta tryck på ESC! För pausa tryck Pause/Break


; Press Esc to terminate script, Pause/Break to "pause"
#include
Global $Paused
HotKeySet("{END}", "TogglePause")
HotKeySet("{ESC}", "Terminate")



WinWaitActive("Impulse - The battle for power - Opera")
$energy = 0
$rob = 1
$money = 3
$hp = 3
$inBattle = 0
$time = 0
$escapeInstant = 0
$escapeBugg = 0
$inloggare = 0


Sleep(100)
MsgBox(0,"Impulse levlingbot",$time)
Sleep(100)



;If $lvl = "1" Then
rob1()
;ElseIf $lvl = "2" Then
; rob2()
;elseif $lvl = "3" Then
; rob3()
;ElseIf $lvl = "4" Then
; rob4()
;ElseIf $lvl = "5" Then
; rob5()
;ElseIf $lvl = "6" Then
; rob6()
;EndIf











Func rob1()


;Lvling!
While $rob = 1


MouseClick("left", 99, 118)
;Sleepa istället för att vänta
Send("{Enter}")
;WinWaitActive("Sidan på http://www.impulse.nu säger:")
If WinActive("Sidan på http://www.impulse.nu säger:","Du tjänar") Then
Send("{Enter}")


EndIf

Sleep(300)
$hp = $hp + 1


Func finkan()
While $finkan = 1 ; Finkan


$finkan = _imagesearch("Bild.bmp",0,$x2,$y2,255)
if $finkan = 1 Then
MouseMove($x2,$y2,20)

Endfunc
EndIf

sleep(100)

$money = $money + 1
If @error Then

;inget
Else
Sleep(25)
Send("{ENTER}")
MouseClick("left",$finkan[0],$finkan[1])
;en extra klick på samma ställe, ifall det buggar
Sleep(25)
MouseClick("left",$finkan[0],$finkan[1])
Sleep(25)
Send("{ENTER}")
Sleep(25)
MouseClick("left", 102, 140)

Send("{ENTER}")

EndIf



If WinActive("Meddelande från webbsida","Du har inte råd!") Then
Send("{ENTER}")
Sleep(800)
If WinActive("Meddelande från webbsida","Du har inte tillräckligt med energi!") Then
Sleep(755)
Send("{ENTER}")
Sleep(450)
MouseClick("left", 606, 229)
Sleep(350)
MouseClick("left", 539, 319)
;Sleep(0)
;MouseClick("left", 300, 710)
Sleep(1000)
Send("{3}")
Send("{5}")
Send("{0}")
Send("{0}")
Send("{0}")
Send("{0}")
Sleep(1000)
MouseClick("left", 502, 712)
Sleep(50)
MouseClick("left", 502, 712)
Sleep(250)
MouseClick("left", 502, 712)
Sleep(250)
Else
;i Fängelse ta ut och muta ut
Sleep(450)
Send("{ENTER}")
Sleep(250)
MouseClick("left", 361, 392)
Sleep(250)
MouseClick("left", 539, 319)
Sleep(250)
MouseClick("left", 550, 370)
Sleep(250)
Send("{1}")
Send("{4}")
Send("{9}")
Send("{6}")
Send("{4}")
Send("{3}")
Sleep(150)
MouseClick("left", 696, 371)
Sleep(150)
MouseClick("left", 359, 351)
Sleep(250)
;MouseClick("left", 535, 450)
;Sleep(250)
If WinActive("Sidan på http://www.impulse.nu säger:","smugglade") Then
Sleep(250)
Send("{ENTER}")
Sleep(250)
MouseClick("left", 41, 90)
Sleep(250)
EndIf
EndIf
EndIf


Sleep(75)
If WinActive("Sidan på http://www.impulse.nu säger:","Affären") Then
Send("{ENTER}")
Sleep(15000)
EndIf

Sleep(25)

If $money = 100 then
Sleep(25)
MouseClick("left", 123, 174)
Sleep(25)
Send("{ENTER}")
Sleep(25)
$money = 0

EndIf

Sleep(25)

If $hp = 100 Then
Sleep(25)
MouseClick("left", 95, 156)
Sleep(25)
Send("{ENTER}")
Sleep(25)
$hp = 0
EndIf

Sleep(55)

If WinActive("Sidan på http://www.impulse.nu säger:","Du gick upp i level!") Then
Sleep(350)
Send("{ENTER}")
Send("{ENTER}")
Send("{ENTER}")
Sleep(350)
MouseClick("left", 99, 99)

EndIf

Sleep(75)
If WinActive("Sidan på http://www.impulse.nu säger:","Du gjorde") Then
Send("{ENTER}")
Sleep(150)
MouseClick("left", 548, 420)
EndIf

Sleep(75)

If WinActive("Sidan på http://www.impulse.nu säger:","Du blir rånad av") Then
Sleep(250)
Send("{ENTER}")
Sleep(250)
MouseClick("left", 312, 272)
Sleep(250)
WinWaitActive("Sidan på http://www.impulse.nu säger:")
Sleep(250)
Send("{ENTER}")
Sleep(150)
EndIf

Sleep(50)

;checkar om programmet har buggat i strid
$buggStrid = PixelSearch( 750, 560, 765, 576, 0xCA660B, 5, 2 )
If @error Then
;inget
Else
$inBattle = 1
$escapeInstant = 1


EndIf

Sleep(70)

If WinActive("Sidan på impulse.nu säger:","Du blir attackerad av") OR $inBattle = 1 Then
Sleep(250)
Send("{ENTER}")
$inBattle = 1
While $inBattle = 1
Sleep(150)

HandleBattleEvent()

;fastnat i strid, kan fly redan (behöver inte vänta)
If $escapeInstant = 0 Then
Sleep(9000)
Endif
;Fly
MouseClick("left", 664, 514)
Sleep(75)
HandleBattleEvent()
Sleep(150)
;Välj flyktväg
MouseClick("left", 221, 306)
Sleep(150)
HandleBattleEvent()
;Hela efter 2 attacker
;Fuling: undvik detta om striden är klar
If $inBattle = 1 Then
Sleep(15500)
MouseClick("left", 472, 515)
Sleep(150)
HandleBattleEvent()
;Uppdatera (attack)
Sleep(8000)
MouseClick("left", 584, 514)
Sleep(150)
HandleBattleEvent()
EndIf
WEnd
$flyInstant = 0
;inBattleEndIf
EndIf
Sleep(75)



WEnd
EndFunc

Func HandleBattleEvent()
Sleep(75)
;ordningen på if-arna spelar ingen roll
If WinActive("Sidan på http://www.impulse.nu säger:","missade") Then
Send("{ENTER}")
MouseClick("left", 548, 420)
EndIf
Sleep(75)
If WinActive("Sidan på http://www.impulse.nu säger:","skada") Then
Send("{ENTER}")
MouseClick("left", 548, 420)
EndIf
Sleep(75)
If WinActive("Sidan på http://www.impulse.nu/ säger:","lyckades") Then
Send("{ENTER}")
$inBattle = 0

Send("{ENTER}")

;testclick, ta bort!
MouseClick("left", 1140, 950)

EndIf
;gör en ny genom att kopiera en sån här och ändra "missade" till ""
;If WinActive("Sidan på http://www.impulse.nu säger:","missade") Then
; Send("{ENTER}")
;EndIf

Sleep(50)

EndFunc






Func rob2()





EndFunc

Func rob3()




EndFunc
Func rob4()


EndFunc
Func rob5()


EndFunc
Func rob6()

EndFunc


;eriks timer
;----------------------------------------
Func resettimer()
$time = TimerInit ( )
EndFunc

Func checktimer()
MsgBox(0,"Time Difference",$time)
EndFunc






























While 1
Sleep(100)
WEnd








Func finkan4ever()
Sleep(350000)
energy()
EndFunc




Func TogglePause()
$Paused = NOT $Paused
While $Paused
sleep(100)
ToolTip('Script is "Paused"',0,0)
WEnd
ToolTip("")
EndFunc





Func Terminate()
Exit 0
EndFunc
I Edited by zetterberg

Share this post


Link to post
Share on other sites



Heh Impulse. Det var många år sen man körde. Trevligt att ses, men läs reglerna och håll dig till dom om du vill vara medlem här ;)

---

Heh Impulse. I played that years ago. Nice to see you, but read the rules and follow them if you want to stay a member here ;)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0