Jump to content
UBot Underground

Referencing a different tab with a UI HTML button


Recommended Posts

Hi folks,

 

I have a bot using two different tabs. I have several 'Define' nodes in the first and just an input area in the second, since it needs more room. The inputs in the second tab are global and relate to the first. Basically it is a single software in two tabs.

 

I have a button in the html UI panel in tab 2 which I set to run a script contained in tab 1. However it doesn't seem to work.

 

I assume custom commands are not global and so I have to figure how to run tab 1 scripts from tab 2. Can this be done simply?

 

Otherwise I'd have to copy my whole script to tab 2 and that doesn't seem like the easiest option.

 

Hopefully that explains the problem. So the question is:

 

How do I write my 'onclick' command for the tab 2 button so that it runs a script in tab 1?

 

Thanks in advance,

 

Dave

Link to post
Share on other sites

You can run any defined command/function from any tab, no matter in which tab it is placed.

 

The HTML button should look like:

<input type="button" value="BUTTON" onclick="ubot.runScript('Script()')">

Where "Script()" is the name of your script (empty brackets tell UBot that there are no parameters)

Link to post
Share on other sites

Ok thanks. That's what it looks like. It just didn't work when, of all times, I was doing a video tutorial.

 

I'll check it over again.

 

I just wasn't sure as I know you can get scripts that put tabs in a single pane, whereas I have used the Ubot 'add a new script' button.

 

Back to the drawing board.

 

Thanks again,

 

Dave

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