Jump to content
UBot Underground

Define - Command / Function ?


Recommended Posts

Maybe a dumb question but id like to know if someone can please define and or describe the difference between the "Function" & "Command" choice in the "Define" command. 

 

Thank you.

Link to post
Share on other sites

simple example

define $mathfunc(#var1#var2) {
    set(#var1#var1"Local")
    set(#var2#var2"Local")
    set(#result$add(#var2#var1), "Global")
    return(#result)
}
set(#i need the value$mathfunc(5, 9), "Global")

  • Like 1
Link to post
Share on other sites

Thanks a lot bro.. I appreciate it.

 

BUt this doesn't really explain the difference between the "Function" & "Command" choice in the "Define" command.

Link to post
Share on other sites
add item to list(%msgbody1, $list from file(#msgbody), "Delete", "Global")
set(#emails position, 0, "Global")
loop(#threads) {
thread {
loop while($comparison(#counter, "<", $list total(%emails))) {
next email cmd()
connect to mail server("SMTP", #pass, #password, #domain, #port) {
wait(1)
send email($next list item(%emails), $random list item(%subjects), "HTML", #next email, "", $next list item(%froms), "")
increment(#counter)
wait(#wait)
wait(.5)
}
}
set(#done, $true, "Global")
stop script
}
}
define next email cmd {
wait($rand(1, $add(#threads, 1)))
set(#next email, $replace regular expression(%msgbody1, "EMAIL-MACRO", $list item(%emails, #emails position)), "Local")
increment(#emails position)
}

Here is what i'm trying to do. I set the define to "command" and left "parameters" blank.

PLEASE HELP..!

Link to post
Share on other sites

"thread" needs  a  "in new browser" too without it wont work also u can use "set visibility"  search for in ubot
thread {
    in new browser {
        set visibility("Visible")

        here your stuff

    }
}

 

difference between func  and command

define $mathfunc(#var1#var2) {
    set(#var1#var1"Local")
    set(#var2#var2"Local")
    set(#result$add(#var2#var1), "Global")
    return(#result)
}
set(#i need the value$mathfunc(5, 9), "Global")  <---absolut exclusive

 

define mathfunccomand(#var1#var2) {
    set(#var1#var1"Local")
    set(#var2#var2"Local")
    set(#result$add(#var2#var1), "Global")
}
mathfunccomand(9, 4)
set(#i need the value#result"Global")  <---a bitch everyone knows 

sure for coders are both functions  but ubot got a bit his own rulez
hope u understand yet

Link to post
Share on other sites

I am using "connect to mail server". 

 

This is a socket command, does not use a browser (i don't thinkg) my Mailer has been working fine with out "in new browser"..

 

Are you sure i need to use "in new browser" for connect to mail server ?

Link to post
Share on other sites

A simple define (command) is the equivalent of a sub-routine that performs code and affects data for variables/list/tables that are set as Global inside its container, w/o returning ANY result at all per se = it is only a series of commands that repeat themselves.

The function version of the define, is a series of commands that will return ONE variable value, the one specified by the RETURN command within its code.

That makes it very useful.

 

Personally, I only use functions, even when there is no particular output that I need from the define, but at least I return a false/true value as a measure of the functions' ability to perform all the code it was supposed to.

 

EXAMPLE

 

Many people use a simple DEFINE (as a command) for a signup or signin/login to a site

 

I prefer to use a FUNCTION instead, that returns the true/false value, telling the calling main program that the function was able to execute correctly (logged in successfully, or created an account successfully, etc...)

 

Makes more sense now?

  • Like 2
Link to post
Share on other sites

Thank you so much VaultBoss i could not have asked for a more clear response. This totally explains EXACTLY what i needed.

 

blumi40 i thank you as well for trying.

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