Jump to content



Photo

Ui Html Panel - Change Text

Ui Html Panel

  • Please log in to reply
5 replies to this topic

#1 unurohack

unurohack

    Member

  • Members
  • PipPip
  • 12 posts
  • OS:Windows 8
  • Total Memory:More Than 9Gb
  • Framework:v4.0
  • License:Professional Edition

Posted 07 August 2018 - 10:05 AM

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, 07 August 2018 - 10:06 AM.


#2 UBotBuddy

UBotBuddy

    UBot Studio Training

  • ADMIN
  • 3514 posts
  • LocationVirginia
  • OS:Windows 10
  • Total Memory:8Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 07 August 2018 - 12:31 PM

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


UBot Training for FREE! Yes, that is correct!

#3 HelloInsomnia

HelloInsomnia

    Advanced Member

  • Moderators
  • 2845 posts
  • OS:Windows 10
  • Total Memory:More Than 9Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 07 August 2018 - 01:10 PM

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")


#4 unurohack

unurohack

    Member

  • Members
  • PipPip
  • 12 posts
  • OS:Windows 8
  • Total Memory:More Than 9Gb
  • Framework:v4.0
  • License:Professional Edition

Posted 07 August 2018 - 07:17 PM

 

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!



#5 LazyBotter

LazyBotter

    Advanced Member

  • Fellow UBotter
  • PipPipPip
  • 727 posts
  • LocationManchester
  • OS:Windows 8
  • Total Memory:More Than 9Gb
  • Framework:v3.5 & v4.0
  • License:Developer Edition

Posted 08 August 2018 - 02:55 AM

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!


Screenshot-2018-08-08-11.18.50-e15337237


#6 UBotBuddy

UBotBuddy

    UBot Studio Training

  • ADMIN
  • 3514 posts
  • LocationVirginia
  • OS:Windows 10
  • Total Memory:8Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 08 August 2018 - 04:40 AM

Huh!  I learned something too!  Nice!

 

Buddy


UBot Training for FREE! Yes, that is correct!





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users