Jump to content
UBot Underground

New User Tutorial Define Command Callback Functions


Recommended Posts

Hey all,

 

Just a quick tip or tutorial,I guess this has been covered somewhere,and probably in more detail,if it has please leave a comment showing where,and I will close this thread,just done a quick search for callback function on ixquick,no results

 

Wrong Way and the Right Way of creating Callback functions ie piloting your code from top to bottom or bottom to the top

 

To save extra loops,and as a new user you have probably come across the following dilemma,

Problem

your script is near the end and if something you require happens you want the script to go back to the beginning,or most importantly you make a program that runs on commands,when you tell it to carry out an action,and maybe you put in a loop while to the start of the program,or added an extra chunk to the bottom half of the program ha ha,here is what define is actually for,it is not used for making shortcuts,that is just an advantage to its purpose

 

Callback Function Example

 

define $test one(#test one) {
    alert(1)
    wait(2)
    set(#next,    $test two(""),"Global")
    Comment("the variable next contains the newly defined parameter below,{    $test two()},so after executing {    $test one()} it goes on to execute {    $test two()}")
}
define $test two(#test two) {
    alert(2)
    wait(2)
    set(#next,    $test one(""),"Global")
    Comment("the variable next contains the newly defined parameter {    $test one()},so after executing {    $test two()} it goes on to execute {    $test one()}")
}
set(#run test one followed by calling test two and back,$test one(""),"Global")
Comment("The Resulting programs simply alerts 1 followed by two every 2 seconds for infinity")

 

Comment("The Resulting programs simply alerts 1 followed by two every 2 seconds for infinity")

 

thanks

next step learn asynchrounous scripting,theres a post here in the forum with an example,havnt looked myself,again I only looked asynchronous script in ubot from reading about it in javascript ha

  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...