Jump to content
Sign in to follow this  
NosTplayeR

problem script

Recommended Posts

NosTplayeR

hi first of all id like to ask how if you can help me i have a script that was copied in the other forum but the script need to be edited to use the loot and rest function

here's the script

HotKeySet("{Home}","start")

Hotkeyset("{END}","stop")

Hotkeyset("{PAUSE}","Pause")

Global $Paused

Global $Wait

if Not WinExists("Nostale") then

MsgBox(64, "NosBot", "You must be running Nostale")

Exit

EndIf

MsgBox(64, "NosBot", "To Start the Bot Press the Home Key, and to stop press the End Key, and to pause Press the Pause key")

Wait()

Func start()

WinActivate ( 'Nostale' )

Sleep(500)

while 1

If PixelGetColor(280, 175) = 0xE0B200 Then

Rest()

Else

Target()

loot() <--i just added this so (but if u have suggestion how can i func the loot tell me)

EndIf

WEnd

EndFunc

Func Target()

Send("{Space}")

Sleep(250)

Send("{Space}")

Sleep(500)

EndFunc

Func loot()

Send("`")

Sleep(500)

EndFunc

Func Rest()

Send("t") <---- i dont know why it press like a million times lol

EndFunc

Func Pause()

$Paused = NOT $Paused

While $Paused

ToolTip("NosBot: Paused ", 2, 0)

Sleep (400)

WEnd

EndFunc

Func Wait()

$Wait = NOT $Wait

While $Wait

ToolTip("NosBot: Press the HOME key to start, Press the END key to Terminate ", 2, 0)

Sleep (400)

WEnd

EndFunc

Func stop()

ToolTip("NosBot: Shutting Down ", 2, 0)

MsgBox(64, "NosBot", "whatever")

Exit

EndFunc

how can you press a key once? for example send("t") "but it just press once not a million times-.-"

if anyone playing this game can help me? or any suggestions?

Share this post


Link to post
Share on other sites
Andreik

This line is wrong.

If PixelGetColor(280, 175) = 0xE0B200 Then

PixelGetColor returns decimal value of pixel's color and you tried to compare to a hex value.

So, try this:

If "0x" & Hex(PixelGetColor(280, 175),6) = 0xE0B200 Then
Edited by Andreik

When the words fail... music speaks

Share this post


Link to post
Share on other sites
SmOke_N

This line is wrong.

If PixelGetColor(280, 175) = 0xE0B200 Then

PixelGetColor returns decimal value of pixel's color and you tried to compare to a hex value.

So, try this:

If "0x" & Hex(PixelGetColor(280, 175),6) = 0xE0B200 Then
;) You're telling him to compare a string to an unsigned integer.

If (PixelGetColor(280, 175) == 0xE0B200) Then

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.

Share this post


Link to post
Share on other sites
Andreik

;) You're telling him to compare a string to an unsigned integer.

If (PixelGetColor(280, 175) == 0xE0B200) Then
Maybe your exemple is more better but if you try you`ll see that my example run correctly.

When the words fail... music speaks

Share this post


Link to post
Share on other sites
SmOke_N

Maybe your exemple is more better but if you try you`ll see that my example run correctly.

It's not a matter of getting the desired result, it's a matter of doing it correctly to begin with. Comparing two different data types is not a "correct" method for a boolean return without casting them to the same type of data type.

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.

Share this post


Link to post
Share on other sites
RZLucian0127

uhm... i have a few suggestions..

first before u begin in While line while handling the Nostale window, put send('!1'). because you will get a bug in PixelGetColor() Function for sure.

bugs:

can't detect minHP, maxHP, minMP, maxMP

Example:

; Default Setting of your Desktop Resolutions. ("!2") Next Screen Resolutions
; if Default is 800x600, and your bot is set to 1024x768, then send ('!2'). because ('!1') is 800x600.
; Hehehe thats all for my suggestion ^__^ i got my own bot in Nostale so i share some tips :)
; i got 1 bug in my bot when the target arrow is set to player.. it will follow the player whenever the player goes T__T.

$ScreenSet = False

While 1
    WinWaitActive($WinOfNosTale)
    If Not $ScreenSet Then
        Send ("!1")
    EndIf
WEnd
Edited by RZLucian0127

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  

×