unurohack 1 Posted August 7, 2018 Report Share Posted August 7, 2018 (edited) 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 August 7, 2018 by unurohack Quote Link to post Share on other sites
UBotBuddy 331 Posted August 7, 2018 Report Share Posted August 7, 2018 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 Quote Link to post Share on other sites
HelloInsomnia 1103 Posted August 7, 2018 Report Share Posted August 7, 2018 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") 3 Quote Link to post Share on other sites
unurohack 1 Posted August 8, 2018 Author Report Share Posted August 8, 2018 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! 1 Quote Link to post Share on other sites
LazyBotter 188 Posted August 8, 2018 Report Share Posted August 8, 2018 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! 1 Quote Link to post Share on other sites
UBotBuddy 331 Posted August 8, 2018 Report Share Posted August 8, 2018 Huh! I learned something too! Nice! Buddy Quote Link to post Share on other sites
Emanu2000 2 Posted October 30, 2018 Report Share Posted October 30, 2018 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"> Quote Link to post Share on other sites
HelloInsomnia 1103 Posted November 4, 2018 Report Share Posted November 4, 2018 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/ 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.