Author Topic: menu's and menu designer  (Read 4576 times)

0 Members and 1 Guest are viewing this topic.

Offline _C2_Topic starter

  • AFK FtW
  • Global Moderator
  • *
  • *
  • Posts: 4077
  • Activity:
    0%
  • Reputation Power: 48
  • _C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!
  • RIP Pen Trick
  • Respect: +254
  • Referrals: 4
    • View Profile
menu's and menu designer
« on: May 03, 2009, 10:11:12 AM »
0
This is a work in progress... I will be adding how to update text for change in skills and what not very soon. There is still more to come but here are some basics!!!

This tutorial is for beginning to advanced users of menus. I will take some time to go through all the different options on the menu designer (tool from easy uo) and how you can use them.

The post is organized into the following categories:
(1) What you will need or will help you
(2) Menu Buttons
(3) Text Boxes
(4) Check boxes
(5) Edit Boxes
(6) Combo Boxes
(7) Updating Menu Text (Including Deleting/Replacing Buttons)

What You Need or Will Help You:
First i suggest that you go to easyuo.com and download 2 things that will make life easier and slightly more fun!

First download Easyuo 1.42.00B4 (Old version in archives) New version won't interact correctly/

Second Download the EUO Menu Designer.

Now that you have them both you are ready to create menus that you can copy and paste into your scripts!

*Note: You must open easy uo 1.42 before you try to open the menu designer. I don't know why but it is picky like that.

The Menu Designer will make a sub for your menu. Its generic name given is sub EUOMenu1. You can change that as you wish. Then just play the menu sup at start up!

Basic Buttons:
The first button we will look at is the menu button. This is the symbol that is a rectangle with OK typed on it.

Buttons are used to start, pause, quit, do a certain command like a hot key would etc. There is a variable in easyuo that looks for the value #menubutton. You can use this value within your script to control the flow using buttons.

Ex.) When I play my script it plays the sub above ( gosub showEUOMenu1 ). The menu comes up but keeps running into the script before I can click my options that I want and press start. Using the value #menubutton, you can set- up the control like this!

at the bottom of your menu simply add...
Code: [Select]
set #menubutton  N/A
repeat
until #menubutton <> N/A
This will sit and repeat until you click a menu
button - such as a start button. If you have multiple buttons and worry about another button starting you, you can do the same thing but use the name of the button as I did below.

Here is the code from the menu with the lines addressed in purple!
Code: [Select]
sub showEUOMenu1
    menu Clear
    menu Window Title Donate-o-Matic
    menu Window Color Silver
    menu Window Size 243 167
    menu Font Transparent #true
    menu Font Align Right
    menu Font Name Comic Sans MS
    menu Font Size 12
    menu Font Style b
    menu Font Color WindowText
    menu Font Transparent #false
    menu Font Align Left
    menu Font BGColor Silver
    menu Text EUOLabel1 28 4 Where:
    menu Font Color Black
    menu Text EUOLabel2 28 56 What:
    menu Font Color WindowText
    menu Text EUOLabel3 28 108 Animal
    menu Font Size 8
    menu Text EUOLabel4 184 44 Spot
    menu Text EUOLabel5 216 44 Spot
    menu Text EUOLabel6 216 60 Two
    menu Text EUOLabel7 184 60 One
    menu Text EUOLabel8 128 4 Runebook
    menu Text EUOLabel9 188 4 Name:
    menu Text EUOLabel10 116 80 Home/Bank:
    menu Text vesper 116 100 Vesper:
    menu Text ghg 116 120 Brit Ingot:
    menu Text EUOLabel11 116 140 Brit Wood:
    menu Font Name MS Sans Serif
    menu Font Style
    menu Font BGColor Window
    menu Combo Create where 4 28 105
    menu Combo Add where Vesper
    menu Combo Add where Britian
    menu Font Name MS Sans Serif
    menu Font Style
    menu Combo Create what 4 80 105
    menu Combo Add what Wood
    menu Combo Add what Ingots
    menu Font Name MS Sans Serif
    menu Font Style
    menu Font BGColor Gray
    menu Button begin 116 48 59 25 Begin
    menu Font BGColor Window
    menu Combo Create animal 4 128 105
    menu Combo Add animal Beetle
    menu Combo Add animal Pack Horse
    menu Edit runebook 136 20 81 donation
    menu Edit homeone 189 80 19 1
    menu Edit hometwo 216 80 21 2
    menu Edit vesperone 188 100 21 3
    menu Edit vespertwo 216 100 21 4
    menu Edit britingotone 188 120 21 5
    menu Edit britingottwo 216 120 21 6
    menu Edit britwoodone 188 140 21 7
    menu Edit britwoodtwo 216 140 21 8
    menu Show 421 270
    menu HideEUO
[color=purple] set #menubutton N/A
  repeat
  until #menubutton <> N/A[/color]
 menu hide
return
The red sections are other menu commands that hide easy uo so it doesn't stay up on screen and the other hides the menu so it is minimized.

ie:
Code: [Select]
set #menubutton  N/A
repeat
until #menubutton = begin
I also like to add this line in again afterwords because i use many buttons in scripts and don't want the script to keep thinking I pressed the button over and over. I clear the value by simply entering:
Code: [Select]
set #menubutton  N/A again after the menu button has played what I wanted it to. That way it sits inactive until you press a menu button again.


you can also set up a if statement to control your buttons in your script...

Code: [Select]
if #menubutton <> N/a
     gosub menubuttons
or
if #menubutton = pause
     gosub pause
You can see some buttons under the section for check boxs on my pvp healer menu below. When ever the #menubutton <> N/A (<> means not equal to/ anything but the following value), I do a gosub and find out what button has been pushed, preform an action needed, and reset it to N/a so it is ready to go again.

Text Box:
This is the button with the capital letter A on it. When you press it, you get a Box to type text in the spot you click the menu. Outside of labeling sections of your menu, there really isn't a lot of use for this section. You can change font size, color, etc under font on the left and even change the background color.
You can see on my Donate-o-Matic menu where I label sections Spot one and Spot two.

Another helpful use is using text boxes to display changing amounts. IE. Total leather collected, How many unicorns/ kirins donated/ total gold farmed... etc.

I will address updating text boxes in my Updating menu section below! I will show you how I update points collected and unis/kirins donated with my zoo tamer script.

Check box:
This is a very helpful option for clicking options on and off on a menu. This is a great choice for multiple options a user may toggle on and off depending on their goals. There is a #true #false option to this box. you can dbl click it on the left and it will change on the grid.
Here is how I use check boxes on my PvP healer. Users decide buy marking the correct boxes what will be focused on.



In order to retrieve that info of it being checked or not, you need to call the menu's name for that check box. If the menu is named apples for that check box, you would do...

Code: [Select]
menu get apples
if #menures = true
       do this

or

menu get apples
If #menures = #false
        Do this
Be careful! The check box like the rest of the options have a name and a caption. Do not call it by caption. Caption is only what font it displays on the menu. You need to call it by the label you placed in the name box on the grid.

Edit Box:

This option is great for entering names or numbers. I use this in my Donate-o-Matic to find a certain runebook. I type in the name and it retrieves it from that box as it is playing. I also use it on my PvP healer allowing each heal method to have its own setting for when to heal at. It is also on the menu for when to refresh too.
In order to retrieve this info, you call the NAME of the button much like the check box above. Let's take my book edit box for example. This is where you type the runebook name

Here is the code for how I call this element in the script and set the name off the menu! I named the box runebook on the menu maker so that is what i call. Then I set the value %bookname to be called later in recalling as the menu resolution!

As I am setting it up in my initialization, I would say:
Code: [Select]
menu get runebook
set %bookname #menures
When getting numbers from the edit box, you do menu getnum (name of box). I use numbers when setting heal at amounts in my PVP healer.
Code: [Select]
menu getnum refreshat
set #menures %chug_refresh
Then in my script, I would have some statement like this...

Code: [Select]
if #stam <= %chug_refresh
    gosub drink %refreshpot
Combo Box:
This is a feature of the menu editor. It allows you to take several things and combo them into one drop down menu. I use this in my Build a Thief, Play that Funky Music and Ultimate casting multi skill trainers. I have a drop down/combo menu to pick the skill instead of having 5-8 diff check boxes taking up space and allowing for double checking mistakes.

Combo Box:
Here is an example from my Donate-o-Matic Script. You have three combo boxes that drop down with choices. one for where to donate, another for what to donate, and a third for type of animal being used. See the picture above. When clicked they drop down a menu of choices that you must add after creating the menu.

To add items to the combo box you just follow the example here for how I added the locations to donate to! Notice that the list has a name and I use that name on each addition so easy uo knows where and what list to add you combo to.

The red text is the lines I added to the menu to add options to the combo box list! You can see how I found the combo line named where in the first red group and then added the add lines in. I also colored the other combo box lines added in.
look below:
Code: [Select]
sub showEUOMenu1
    menu Clear
    menu Window Title Donate-o-Matic
    menu Window Color Silver
    menu Window Size 243 167
    menu Font Transparent #true
    menu Font Align Right
    menu Font Name Comic Sans MS
    menu Font Size 12
    menu Font Style b
    menu Font Color WindowText
    menu Font Transparent #false
    menu Font Align Left
    menu Font BGColor Silver
    menu Text EUOLabel1 28 4 Where:
    menu Font Color Black
    menu Text EUOLabel2 28 56 What:
    menu Font Color WindowText
    menu Text EUOLabel3 28 108 Animal
    menu Font Size 8
    menu Text EUOLabel4 184 44 Spot
    menu Text EUOLabel5 216 44 Spot
    menu Text EUOLabel6 216 60 Two
    menu Text EUOLabel7 184 60 One
    menu Text EUOLabel8 128 4 Runebook
    menu Text EUOLabel9 188 4 Name:
    menu Text EUOLabel10 116 80 Home/Bank:
    menu Text vesper 116 100 Vesper:
    menu Text ghg 116 120 Brit Ingot:
    menu Text EUOLabel11 116 140 Brit Wood:
    menu Font Name MS Sans Serif
    menu Font Style
    menu Font BGColor Window
    menu Combo Create where 4 28 105
   menu Combo Add where Vesper
    menu Combo Add where Britian
    menu Font Name MS Sans Serif
    menu Font Style
    menu Combo Create what 4 80 105
[color=red]    menu Combo Add what Wood
    menu Combo Add what Ingots[/color]
    menu Font Name MS Sans Serif
    menu Font Style
    menu Font BGColor Gray
    menu Button begin 116 48 59 25 Begin
    menu Font BGColor Window
    menu Combo Create animal 4 128 105
   menu Combo Add animal Beetle
    menu Combo Add animal Pack Horse
    menu Edit runebook 136 20 81 donation
    menu Edit homeone 189 80 19 1
    menu Edit hometwo 216 80 21 2
    menu Edit vesperone 188 100 21 3
    menu Edit vespertwo 216 100 21 4
    menu Edit britingotone 188 120 21 5
    menu Edit britingottwo 216 120 21 6
    menu Edit britwoodone 188 140 21 7
    menu Edit britwoodtwo 216 140 21 8
    menu Show 421 270
    menu HideEUO
  set #menubutton N/A
  repeat
  until #menubutton <> N/A
  menu hide
return
To access this information in your script you call the menu list by name like below and check the resolutions by number. if you have 3 items in the list you check for them in order or their listing.
Here is how I call the combo box named "what"
Item #1 in that combo box is wood and #2 is ingots.
Code: [Select]
menu get what
if #menures = 1
   set %donatingthis wood
if #menures = 2
   set %donatingthis ingots
Updating Menu Text:

This is fairly easy to do once you understand the commands:
menu text & menu delete
You also need to understand how to replace the text in the same location which can be found on the original menu. Once you find the correct text line you can use the numbers there to make sure you have the correct location. I will show you how I update my taming menu below.

First there is a really simple thing that I love to do on my menus, as many others do, when I start by clicking the button named begin. I delete that button by name. THis is not the caption... it is the name. I name all my start buttons begin.

Here is how:
Code: [Select]
menu delete begin Pretty simple... but I also like to replace it once I delete it with a pause button. To do this I need the location coords on the menu that the begin button was located. When I look at the menu sub and find the menu button begin.... line, you will see the numbers right there. Here is an example of how I replace the button!

Looking at the menu... you will see the line for menu text begin where I highlighted the numbers red. These numbers are the location. See how I used them below to create the new button in the correct spot.
Code: [Select]
menu Button Begin 104 168 75 25 BeginHere is what I added in to write the new button in!
Code: [Select]
    menu Show 421 270
    menu HideEUO
  set #menubutton N/A
  repeat
  until #menubutton <> N/A
  menu delete begin
    menu Font Color WindowText
     menu Font Size 8
    menu Font BGColor Lime
    menu Button pause 104 168 75 25 Pause ; creates new button
  ;menu hidemenu
  set #menubutton N/A
return
« Last Edit: May 03, 2009, 10:14:22 AM by _C2_ »

Tags: