Jump to content
UBot Underground

variable in ui block text


Recommended Posts

I made an autoresponder bot. I want to be able to change the message it sends out once the bot is compiled, altering the message with a ui block text. However, I need to use other variables with my reply. 

 

Is there anyway to put in the other variables inside the ui block text?

 

for example i want to use a variable that address the recipient  by his/her first name. So i have a #firstname variable..

 

How do I enter #firstname variable into the ui block text?

Link to post
Share on other sites

I think this should do what you are asking.

 

Just put that code into a bot in code view and you will see how it works:

 

ui html panel("<html lang=\"en\"><head><style>
#containment-wrapper \{ width: 99%; height:222px; background-color: #4D8280; padding: 3px; \}
</style>
</head>
<body style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; cursor: auto; \">
<div id=\"containment-wrapper\"><div id=\"textbox1\" style=\"margin-left: 1px; width: 300px; height: 20px; position: relative; left: 25px; top: 19px; \" >
    
<input variable=\"#firstname\" fillwith=\"value\" placeholder=\"\" style=\" background: #FFFFFF; width: px; border:0px groove #000000;\"> <font style=\"font-family: Georgia; font-size: 15; color: #000000;\">First Name</font>

</div><div id=\"blocktext2\" style=\"margin-left: 1px; width: 200px; height: 20px; position: relative; left: 333px; top: -20px; \" >
    
<font style=\"font-family: Georgia; font-size: 15; color: #000000;\">Text</font><br><textarea variable=\"#blocktext\" fillwith=\"value\" placeholder=\"\" style=\" background: #FFFFFF; width: 300px; height: 200px; border: 0px outset #000000;\"></textarea>

</div><div id=\"textbox2\" style=\"margin-left: 1px; width: 300px; height: 20px; position: relative; left: 24px; top: 36px; \" >
    
<input variable=\"#lastname\" fillwith=\"value\" placeholder=\"\" style=\" background: #FFFFFF; width: px; border:0px groove #000000;\"> <font style=\"font-family: Georgia; font-size: 15; color: #000000;\">Last Name</font>

</div><div id=\"textbox3\" style=\"margin-left: 1px; width: 200px; height: 20px; position: relative; left: 24px; top: 74px; \" >
    
<input variable=\"#email\" fillwith=\"value\" placeholder=\"\" style=\" background: #FFFFFF; width: px; border:0px groove #000000;\"> <font style=\"font-family: Georgia; font-size: 15; color: #000000;\">Email</font>

</div><div id=\"colorbutton1\" style=\"margin-left: 1px; width: 200px; height: 20px; position: relative; left: 23px; top: 93px; \" >
    
<button style=\"height: 30px; width: 200px; font-family: Georgia; font-size: 18px; color: rgb(255, 255, 255); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(47, 76, 110); background-position: initial initial; background-repeat: initial initial; \" onmouseover=\"this.style.background=\'#304B63\'\" onmouseout=\"this.style.background=\'#2F4C6E\'\" onclick=\"ubot.runScript(\'addtext()\')\">Add info to text box</button>

</div>
</div></body></html>", 231)
define addtext {
    set(#blocktext, "{#firstname} {#lastname}
{#email}", "Global")
}

 

Link to post
Share on other sites
I made an autoresponder bot. I want to be able to change the message it sends out once the bot is compiled, altering the message with a ui block text. However, I need to use other variables with my reply. 

 

Is there anyway to put in the other variables inside the ui block text?

 

for example i want to use a variable that address the recipient  by his/her first name. So i have a #firstname variable..

 

How do I enter #firstname variable into the ui block text?

Why didn't you open your thread with a clear explanation like this??

Link to post
Share on other sites

That code is just an example of how you can set variables to display in a block text, which is what you asked.

 

Had a look at your pic. Why don't you add the text that you have in the block text to a list, you can then easily add your variables that way, and then you can add the list with the variables already added to the block text.

Link to post
Share on other sites

If this is not what you mean then I'm a bit confused.

 

set(#firstname, "John", "Global")
ui block text("Reply Message:", #replymessage)
clear list(%reply)
add item to list(%reply, "Dear {#firstname},

hi how u doing?", "Delete", "Global")
set(#replymessage, %reply, "Global")
Link to post
Share on other sites

I'm not trying to display the value of the #firstname variable in the ui block text.. I'd use a stat monitor for that...

 

 

I'm trying to set the #blocktext variable with the text and the #firstname variable that i input in the ui block text, when the bot is already compiled.. change the reply message 'on the fly'.

 

When I enter in #firstname variable in ui block text.. it displays ... the variable name instead of its value. 

Link to post
Share on other sites

I don't think you will be able to display the value of the firstname variable that way.

 

If I understand what you are trying to do correctly instead of:

 

Dear '{#firstname}',

hi how u doing?

 

I would make it:

 

Dear #@,

hi how u doing?

then set a new variable: set(#message, $replace(#replymessage, "#@", #firstname), "Global")

 

Try the code below in a bot to see if this will help with what you are trying to do.

ui block text("Reply Message:", #replymessage)
ui button("Send Message") {
    sendmessage()
}
define sendmessage {
    set(#firstname, "John", "Global")
    set(#message, $replace(#replymessage, "#@", #firstname), "Global")
    load html("<textarea variable=\"#bt\" style=\" background: #FFFFFF; width: 300px; height: 270px; \"></textarea>")
    type text(<variable="#bt">, #message, "Standard")
}

 

 

 

 

 

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