Jump to content
UBot Underground

Create A Custom Menu Item


Recommended Posts

Hi,

 

I was wondering if I can create my own menu and can we open a window where the user can enter his preferences on how the bot will work?

An exemple would be appreciated.

 

Thx,

Link to post
Share on other sites

Thank you Sanjeev, That  was helpful, but I want my own menu in a different language.

I want to either translate the actual menu and add my own fields or completely hide the English menu and create my own. Is that possible?

An other option would be to have all my UI in my main tab and access my other tabs through a button.

Example :

In the screenshot below I want to be able to login in the actual tab and scrape followers which the code is in another hidden tab but still execute on the browser of the first tab. Thank you.

 

 UI.jpg

Link to post
Share on other sites

For this you should hide the Ubot menu and instead just make your own in HTML. You could either have a tab which has the settings or you can get a plugin which would allow you to open a new window for it instead.

 

Here is how to setup the tabs, notice the display style is block for the first tab this is what shows by default and its none for the rest. When you switch tabs this switches.

ui html panel("<html>
<head>
<script>
	function activateTab(pageId) \{
          var tabCtrl = document.getElementById(\'tabCtrl\');
          var pageToActivate = document.getElementById(pageId);
          for (var i = 0; i < tabCtrl.childNodes.length; i++) \{
              var node = tabCtrl.childNodes[i];
              if (node.nodeType == 1) \{ /* Element */
                  node.style.display = (node == pageToActivate) ? \'block\' : \'none\';
              \}
          \}
      \}
</script>
</head>
<body>

<div id=\"navbuttons\">
	<input type=\"button\" class=\"navbutton\" value=\"Tab One\" onclick=\"javascript:activateTab(\'tabOne\')\">
	<input type=\"button\" class=\"navbutton\" value=\"Tab Two\" onclick=\"javascript:activateTab(\'tabTwo\')\">
	<input type=\"button\" class=\"navbutton\" value=\"Settings\" onclick=\"javascript:activateTab(\'settings\')\">
</div> <!-- End navbuttons -->

<div id=\"tabCtrl\">
	<div id=\"tabOne\" style=\"display: block;\">	
		first tab
	</div>
	
	<div id=\"tabTwo\" style=\"display: none;\">
		second tab
	</div>
	<div id=\"settings\" style=\"display: none;\">
		settings tab
	</div>
</div>

</body>
</html>",400)
  • 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...