Jump to content
UBot Underground

Using the "Define" Function


Recommended Posts

I understand the "Define" command has replaced the Sub/Run Sub commands, but I can't seem to figure out how to use it.

 

I drag the define function into the script, I name it, and have tried the 2nd option as both a "command" and a "function". I leave the parameters section blank, since I don't know what it's for. I then proceed to put a basic command into where it says "drag commands here". For now, it's just a navigate command.

 

Anyways, I run the bot and nothing happens. How do I get the command/function that I just defined to execute?

 

Cheers!

 

p.s. I'm absolutely loving just about everything in Ubot4 so far, seems like very powerful stuff. :)

Link to post
Share on other sites

There should be an option in the tool box called "Custom Commands". Click it and you should be able to drag your defined command into the script. Click "Run" to run it.

 

Here is a screencast of where to locate that: http://screencast.com/t/21C3INKTHx

 

I'll ask Ed about the parameters section in the define command and he'll give you his insight on it.

  • Like 1
Link to post
Share on other sites

I understand the "Define" command has replaced the Sub/Run Sub commands, but I can't seem to figure out how to use it.

 

I drag the define function into the script, I name it, and have tried the 2nd option as both a "command" and a "function". I leave the parameters section blank, since I don't know what it's for. I then proceed to put a basic command into where it says "drag commands here". For now, it's just a navigate command.

 

Anyways, I run the bot and nothing happens. How do I get the command/function that I just defined to execute?

 

Cheers!

 

p.s. I'm absolutely loving just about everything in Ubot4 so far, seems like very powerful stuff. :)

 

The parameters serve the same purpose as the parameter command in subs before. It allows you to send data that is local to your custom commands.

Link to post
Share on other sites

There should be an option in the tool box called "Custom Commands". Click it and you should be able to drag your defined command into the script. Click "Run" to run it.

 

Here is a screencast of where to locate that: http://screencast.com/t/21C3INKTHx

 

I'll ask Ed about the parameters section in the define command and he'll give you his insight on it.

 

Thank you. Just the kind of push in the right direction I needed :)

 

 

The parameters serve the same purpose as the parameter command in subs before. It allows you to send data that is local to your custom commands.

 

Thanks for the explanation. Is there an example of this being used anywhere, that you can think of?

Link to post
Share on other sites

In case anyone's interested in some sample code:

 

define $HTML Cleanup(#code to use) {
   return("SOME PREDEFINED TEXT + {#code to use}")
}
load html($HTML Cleanup("code that's gonna echo next to the predefined text"))

 

Define is really awesome.

  • Like 1
Link to post
Share on other sites

In case anyone's interested in some sample code:

 

define $HTML Cleanup(#code to use) {
   return("SOME PREDEFINED TEXT + {#code to use}")
}
load html($HTML Cleanup("code that's gonna echo next to the predefined text"))

 

Define is really awesome.

Thanks for the sample lombi.. It helps..

If you have time can you please provide a more complex code using define to play with.. Thanks!

Link to post
Share on other sites
  • 2 weeks later...

There should be an option in the tool box called "Custom Commands". Click it and you should be able to drag your defined command into the script. Click "Run" to run it.

 

Here is a screencast of where to locate that: http://screencast.com/t/21C3INKTHx

 

I'll ask Ed about the parameters section in the define command and he'll give you his insight on it.

 

The link given is a png image, not a screencast. Would really like to see the screencast on how to setup and use define. - Wayne

Link to post
Share on other sites
  • 7 months later...

The parameters serve the same purpose as the parameter command in subs before. It allows you to send data that is local to your custom commands.

 

Today I was playing around with multiple threads, and I have a feeling that parameters mentioned above are NOT set locally, but globally.

 

I was running command inside "Thread" and "New Browser" commands and I was passing parameter which was a number. Right after this part, I incremented that number (outside of "Thread and "New Browser" commands), and I saw that command that was ran previously (still running at this point) used that incremented value, instead of the value I passed as parameter.

 

To fix this I had to set new local variable, and copy parameter value to that variable and delay after passing parameter, so it gets registered in local variable, and it works now.

 

Can someone confirm this is a bug?

 

Thanks, Tadej

Link to post
Share on other sites
  • 2 years later...

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...