Jump to content
UBot Underground

Ui Html Panel - Change Text


Recommended Posts

Hello,

 

I have a simple example for you, maybe someone is able to help me understand how I can make something change in Ui Html Panel.

 

Thank you!

on load("Bot Loaded") {
    set(#variable_here,1,"Global")
}
ui html panel("<!DOCTYPE html>
<html>
<head>



<p><strong><font size=\"13\" color=\"red\">{#variable_here}</font></strong></p>

 
</body>
</html>",200)
set(#variable_here,"NEW TEXT HERE","Global")

Edited by unurohack
Link to post
Share on other sites

Hi,

 

The reason that it does not work the way you want it to is because the UI HTML PANEL is not a dynamic command.  Meaning, it doesn't continually refresh its code.

 

If you were to create a new Tab and then Select it, you would notice that the UI area changes.  When you re-Select your original Tab where your code is you will see that the text value will now load.  This is because of the action you are taking by switching Tabs, it will rebuild the UI area per that command.

 

Buddy

Link to post
Share on other sites

Try this:

on load("Bot Loaded") {
    set(#variable_here,1,"Global")
}
ui html panel("<!DOCTYPE html>
<html>
<head>



<p><strong><font size=\"13\" color=\"red\"><span variable=\"#variable_here\"></span></font></strong></p>

 
</body>
</html>",200)
set(#variable_here,"NEW TEXT HERE","Global")
  • Like 3
Link to post
Share on other sites

 

Try this:

on load("Bot Loaded") {
    set(#variable_here,1,"Global")
}
ui html panel("<!DOCTYPE html>
<html>
<head>



<p><strong><font size=\"13\" color=\"red\"><span variable=\"#variable_here\"></span></font></strong></p>

 
</body>
</html>",200)
set(#variable_here,"NEW TEXT HERE","Global")

 

"span variable" is magic.

Thank you! You're good!

  • Like 1
Link to post
Share on other sites

You can also set attributes on the span for example:

//Output Text
<span variable="#yourVar" fillwith="innertext"></span>
//Output HTML
<span variable="#yourVar" fillwith="innerhtml"></span> 

Hope that helps!

  • Like 1
Link to post
Share on other sites
  • 2 months later...
Hi fellows, is there a way to dynamically load images inside the UI html panel via a variable? example

 

  static = <img src = "john_profile.png" alt = "my image">

 

  dynamic = <img src = "#profile_variable" alt = "my image">

Link to post
Share on other sites

 

Hi fellows, is there a way to dynamically load images inside the UI html panel via a variable? example
 
  static = <img src = "john_profile.png" alt = "my image">
 
  dynamic = <img src = "#profile_variable" alt = "my image">

 

 

Convert the image to base64 first and you can use it in the UI, here is a quick and easy converter for it: https://www.base64-image.de/

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