Seagul Posted September 3, 2006 Posted September 3, 2006 (edited) K if you havent played the basic game is space to target space to attack or you can use skill which I have done. Kills 7 monsters then sits, I tried pixel for the healthbar which is green but I failed this time. Id like to use the sit as well as pixel for emergency potions. Have any ideas to improve my code for NOSTALE 4 is loot 5 is rest q is skill Edited 7.30 pm cst add some of Xenos suggestions. I've never messed with gui yet but is there a way to incorperate just a dialog with the kills count "should work" and how long its been running. HotKeySet("{PAUSE}","Escape") Dim $GetHealth, $Color, $kills $GameWinTitle = "Nostale" WinActivate($GameWinTitle, "") WinWaitActive($GameWinTitle, "", 5) $Color = 0x00AA00; Health Color $kills = 0 While 1 $SearchResult = PixelSearch(313, 130, 313, 131, $Color, 20) If @error Then MouseClick("Left" , 815, 163, 1 , 0); Added to return to coords. Sleep(500) Send("{5}") Sleep("10000") Send("{5}") Else Send("{SPACE}") Sleep(200) Send("{q}") Sleep(5000) Send("{4}") $kills = $kills + 1 EndIf WEnd Func Escape() Exit 0 EndFunc Edited September 4, 2006 by Seagul
zcoacoaz Posted September 3, 2006 Posted September 3, 2006 (edited) I searched for a screenshot online and created this function based on it which you can adapt. Basically it returns one when the health gets so low, but I have ABSOLUTELY no idea if it works since I don't have the game and have never played it. Func LowLife ( ) $Color = PixelSearch ( 90, 21, 91, 22, 5120573, 20 ) If $Color Then Return 1 If Not $Color Then Return 0 EndFuncoÝ÷ Ù¬ÊÚ.±è(!µ·ºÚ"µÍÚ[HBYÝÓYH H[ÙÐÞ ][ÝÑØ[YHÝ ][ÝË ][ÝÖ[ÝYHÈÝÉÌÌÎÉ][ÝÈ BÛYBÑ[ Edited September 3, 2006 by Xenogis [font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]
zcoacoaz Posted September 4, 2006 Posted September 4, 2006 I did the search so that there could be some space for color change. Like I said I have never played the game and am unsure of everything. Tell me if it works. [font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]
Moderators SmOke_N Posted September 4, 2006 Moderators Posted September 4, 2006 Xenogis said: I searched for a screenshot online and created this function based on it which you can adapt. Basically it returns one when the health gets so low, but I have ABSOLUTELY no idea if it works since I don't have the game and have never played it. Func LowLife ( ) $Color = PixelSearch ( 90, 21, 91, 22, 5120573, 20 ) If $Color Then Return 1 If Not $Color Then Return 0 EndFuncoÝ÷ Ù¬ÊÚ.±è(!µ·ºÚ"µÍÚ[HBYÝÓYH H[ÙÐÞ ][ÝÑØ[YHÝ ][ÝË ][ÝÖ[ÝYHÈÝÉÌÌÎÉ][ÝÈ BÛYBÑ[ Also... there's needs to be parenthesis around the number for sleep, I think V2 had no parenthisis didn't it? So instead of Sleep 1 (1 - 10 is the same anyway here (at least in my test))... it would be Sleep(10) 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.
zcoacoaz Posted September 4, 2006 Posted September 4, 2006 SmOke_N said: It has been a while for you hasn't it ... LowLife will alway return 1 whether it's found or not that way... also there's no need for If Not $Color Then Return 0 because if it were the color it would have already returned 1... just a heads up. Maybe something like:Func LowLife() PixelSearch(90, 21, 91, 22, 5120573, 20) If Not @error Then Return 1 Return SetError(1, 0, 0) EndFunc Also... there's needs to be parenthesis around the number for sleep, I think V2 had no parenthisis didn't it? So instead of Sleep 1 (1 - 10 is the same anyway here (at least in my test))... it would be Sleep(10)it has been awhile.... the reason I left these forums was because I started using linux exclusively but recently I have started using windows again. the 'Sleep 1' thing is a REALLY old habbit I got using V2. [font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]
dlshoong Posted October 11, 2006 Posted October 11, 2006 (edited) The REST button (5) is repeating it .I had tried it in the game.It repeats it (5) TWICE but sometimes only ONCE.I think theres somthign wrong somwhere.Can anyone fix it?--------------------------------------------------------------for the first loop it only types ;1. "5" for once2.then sleep for 150003.then type "5" again4.sleeps again2nd loops onward,this might happen;1. "5" for twice (which can also be represented by "55")2.then sleep for 15000 Edited October 11, 2006 by dlshoong
Seagul Posted October 13, 2006 Author Posted October 13, 2006 I think this is the last one I created its lil dif from topic, I get confuse cus when I change each version I had number to end or something wierd lol. HotKeySet("{PAUSE}","Escape") $GameWinTitle = "Nostale" WinActivate($GameWinTitle, "") WinWaitActive($GameWinTitle, "", 5) While 1 $x = 0 Send("{ESC}"); Gets rid of Basic Dialogs Do Send("{SPACE}") Sleep(200) Send("{q}") Sleep(5000) Send("{4}") $x = $x+ 1 Until $x = 7 ;MouseClick("Left" , 842, 199, 1 , 0); Return Near Middle Map MouseClick("Left" , 795, 213, 1 , 0); Left Middle Sleep(500) Send("{5}") Sleep("10000") Send("{5}") WEnd Func Escape() Exit 0 EndFunc
jvanegmond Posted October 16, 2006 Posted October 16, 2006 Func GetOwnHealth() $y = 130 - 72 + $Pos[1] $intX = 217 - 109 + $Pos[0] $endX = 354 - 109 + $Pos[0] For $x = $intX to $endX If PixelGetColor($x,$y) == 1447446 Then ExitLoop EndIf Next Return Int(($x-$intX)/($endX-$intX)*100) EndFunc Func GetTargetHealth() $y = 173 - 72 + $Pos[1] $intX = 481 - 109 + $Pos[0] $endX = 590 - 109 + $Pos[0] For $x = $intX to $endX If PixelGetColor($x,$y) == 5395026 Then ExitLoop EndIf Next If $x == $endX+1 Then If Not (PixelGetColor($x-1,$y) == 447521) Then Return -1 EndIf EndIf Return Int(($x-$intX)/($endX-$intX)*100) EndFunc My bot pwns yours, and I'm not releasing. github.com/jvanegmond
Seagul Posted October 17, 2006 Author Posted October 17, 2006 Doubt it, I could train some high level peas on you then tele to miniland in friendlist and your pwned bot would die.
jokke Posted October 25, 2006 Posted October 25, 2006 Manadar said: Func GetOwnHealth() $y = 130 - 72 + $Pos[1] $intX = 217 - 109 + $Pos[0] $endX = 354 - 109 + $Pos[0] For $x = $intX to $endX If PixelGetColor($x,$y) == 1447446 Then ExitLoop EndIf Next Return Int(($x-$intX)/($endX-$intX)*100) EndFunc Func GetTargetHealth() $y = 173 - 72 + $Pos[1] $intX = 481 - 109 + $Pos[0] $endX = 590 - 109 + $Pos[0] For $x = $intX to $endX If PixelGetColor($x,$y) == 5395026 Then ExitLoop EndIf Next If $x == $endX+1 Then If Not (PixelGetColor($x-1,$y) == 447521) Then Return -1 EndIf EndIf Return Int(($x-$intX)/($endX-$intX)*100) EndFunc My bot pwns yours, and I'm not releasing. Thanks you Manadar for this code made it all much easier. UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.
jvanegmond Posted October 25, 2006 Posted October 25, 2006 I forgot to mention, that $pos has to be the return from WinGetPos() from the Nostale window. github.com/jvanegmond
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now