Jump to content

Recommended Posts

Posted

Okay first off apologies for such a simple question, newbie and all

i have searched and checked tutorials but cant seem to find an answer which prob means its very simple

I am trying to call a function within a script but keep on getting bounced with syntax errors

; Randomize
Func _spf() 
    $rdlate = Random(50, 350, 1); 
    $spx = Random(1,10,1); 
    $spy = Random(1,10,1); 
EndFunc

;bag grab
$bagcycle = 0
_spf
MouseClick ("left", ($bex+$spx), ($bey+$spy), 1)
Sleep($lx+$rdlate)
MouseClickDrag ("left", ($bex+$spx), ($bey+$spy), ($invx+$spx), ($invy+$spy), (($rdlate/10)+$drag))

again apols and any help appreciatted

Posted

To call a function you have to remember the () after the name, just like in your declaration:

_spf()

To call the function. Remember that $rdlate, $spx and $spy have to be declared globally for that script to work.

Posted

To call a function you have to remember the () after the name, just like in your declaration:

_spf()

To call the function. Remember that $rdlate, $spx and $spy have to be declared globally for that script to work.

doh

sorry only been at this for a day :D

many thanks

Posted

If you didn't already know, you can also make parameters for your functions and have return values, but you can read more about that in the Help file :D

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...