salter Posted December 6, 2006 Posted December 6, 2006 hey im having troubles with using the parameters in one of my functions, heres the code: Func Walkto($Xcoord, $Ycoord) $Xcoord = $ChestX $Ycoord = $ChestY WinActivate("Mythwar") sleep(1500) $CoordX = _NCR(649, 52, 669, 64) $FinalX = $ChestX - $CoordX If -5 > $FinalX Then ToolTip("MythBot: going west", 2, 0) $west = 1 EndIf If $FinalX > 5 Then ToolTip("MythBot: going east", 2, 0) $east = 1 EndIf $CoordY = _NCR(673, 52, 695, 64) $FinalY = $ChestY - $CoordY If -5 < $FinalY Then ToolTip("MythBot: going south", 2, 0) $north = 1 EndIf If $FinalY < 5 Then ToolTip("MythBot: going north", 2, 0) $south = 1 EndIf If $east = 1 Or $west = 1 Or $north = 1 Or $south = 1 Then ChestWalk() EndIf EndFunc now in another function i have this: Walkto(237,675) so i want it to use 237 for Xcoord and 675 for Ycoord in the Walkto function but Xcoord and Ycoord never have a value, if someone could tell me how to fix this that would be great
PaulIA Posted December 6, 2006 Posted December 6, 2006 now in another function i have this: Walkto(237,675) so i want it to use 237 for Xcoord and 675 for Ycoord in the Walkto function but Xcoord and Ycoord never have a valueOh, they have a value alright. However, you take care of that in the first two lines of code: Func Walkto($Xcoord, $Ycoord) $Xcoord = $ChestX ; <--- so much for that $Xcoord value that was passed $Ycoord = $ChestY ; <--- yep, you just killed the $Ycoord value too Auto3Lib: A library of over 1200 functions for AutoIt
salter Posted December 6, 2006 Author Posted December 6, 2006 o lol that was a pretty stupid mistake lol thx
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