Jump to content
UBot Underground

Define Command Best Usage


Recommended Posts

Hi Folks

I would like to know what the best way to use the define command.

I have read through all the threads but would like to tap into the Gurus minds and find out what is the practical real world best practices for using the define command in bots.

From what I have figured out it can make the bots pretty light and as it could eliminate duplicate code if the bots routines are planned well.

 

Is it possible to keep all the defined commands in one functions tab?

i.e. a tab that holds all set functions and command.

 

Then from other tabs that process tasks call on the commands using the custom command.

 

Are these define commands global and work across all tabs in a bot?

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

i think it's a good usage, i don't know if we can use the define command or function as a seperated ubot file, so if we need we can call it, like call javascript file in the html page. does anyone know if ubot have this function?

Link to post
Share on other sites

Define Command

 

This can be used to "Yes" Lighten your code for repetitive tasks.

 

Simply Define a New command. Name it and place all the nodes in there that you are going to run over and over again at different points of your application.

 

Or

 

Create a Define Command that holds all the account creation information, that you will then place into a loop and repeat the same process over and over again

 

 

Define command will also help you in that stead of having to copy and paste all the nodes, or recreate it in another bot. If you need to transfer the code quickly and easily you can copy the define command and paste it into another bot your working on and all the code will transfer easily.

 

 

 

Define a Function

 

Defining a Function is a bit more complex. This with used will return a value. That you can set to a variable. Much like the Current functions available in Ubot now you can create your own Custom Functions and return the result to a variable, and do with it as you need.

 

 

Remote include of commands, functions, or files is not currently supported.

 

TJ

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

 

Define a Function

 

Defining a Function is a bit more complex. This with used will return a value. That you can set to a variable. Much like the Current functions available in Ubot now you can create your own Custom Functions and return the result to a variable, and do with it as you need.

 

 

Remote include of commands, functions, or files is not currently supported.

 

TJ

Do you have an example of a define function? I feel like it might be something I'm missing out on.

Link to post
Share on other sites
  • 1 year 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...