Jump to content
UBot Underground

Recommended Posts

theres a few attributes like onClick,onChange and one or two others,example

ui html panel("<div variable=\"#num\"></div>",200)
if($comparison($add(2,2),"=",4)) {
    then {
        set(#num,"true","Global")
    }
    else {
    }
}

ui html panel("<button onClick=\"ubot.runScript(\'hello\')\">Say Hello</button>",200)
define hello {
    alert("hello")
}
Link to post
Share on other sites

ive asked for conditional UI items before and would be great if they did put them in.

Place the condition as a function.
that gets placed into the conditional part of the UI item.
if not present it shows always.  else reads by the conditional statement.
 

Link to post
Share on other sites

 

theres a few attributes like onClick,onChange and one or two others,example

ui html panel("<div variable=\"#num\"></div>",200)
if($comparison($add(2,2),"=",4)) {
    then {
        set(#num,"true","Global")
    }
    else {
    }
}


That's not really going to work for him.

 

He stated:

if

  2+2=4

then

  display this UI commands

then

  other UI commands

 

So he would need to give those ui commands a variable, which will not work inside a div that has it's own variable.

 

I don't know why they won't do what TJ suggested.

 

Franciscotorresny I can only think of one workaround to do this.

 

Create 2 versions of the ui.

With ui 1, include the ui commands required if 2+2=4  

with ui 2, include the commands required if 2+2 does not equal 4

 

You can use one of pash's plugins, "Advanced Ubot 2" I think, use the UI HTML Refresh command to set the required ui.

Link to post
Share on other sites

That's not really going to work for him.

 

He stated:

if

  2+2=4

then

  display this UI commands

then

  other UI commands

 

So he would need to give those ui commands a variable, which will not work inside a div that has it's own variable.

 

I don't know why they won't do what TJ suggested.

 

Franciscotorresny I can only think of one workaround to do this.

 

Create 2 versions of the ui.

With ui 1, include the ui commands required if 2+2=4  

with ui 2, include the commands required if 2+2 does not equal 4

 

You can use one of pash's plugins, "Advanced Ubot 2" I think, use the UI HTML Refresh command to set the required ui.

 

thanks for pointing that out,I usually use javascript to write my HTML,and it is even with that a pain to get variables back and forth,I've written a script here maybe Seth can look at it and have it fixed,this is really bad that this doesn't work for Ubot,if it was,making HTML would be easy

 

I also know for a fact,user HaHaItsJake can write dynamic HTML with pure Ubot,Ive PM'd him for his take on this,anyways hope Ubot can make this script work properly for the Ubotters here

 

By the way for people these are UI Commands within the myhtml variable,you can use the script I wrote on the Eval UI Method thread I posted,to get the HTML code for UI commands

ui html panel("
<div id=\"container\" variable=\"#myhtml\" fillwith=\"innerhtml\">
</div>
    ",200)
set(#myhtml,"<div class=\"uielement\">Over 18<br><input type=\"checkbox\" variable=\"#age\" fillwith=\"checked\"></div><button name=\"replacethis\" onclick=\"ubot.runScript(\'confirmAge()\')\">confirm</button>","Global")
define confirmAge {
    if($comparison(#age,"=","true")) {
        then {
            set(#myhtml,"    <div>Sex<br><select ><option value=\"\"></option><option value=\"Male\">Male</option><option value=\"Female\">Female</option></select></div>","Global")
        }
        else {
            set(#myhtml,"<p>Sorry....You must be over 18 to proceed </p>","Global")
        }
    }
}
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...