ScriptUO

Scripting Resources & Utilities => OpenEUO Scripts => OEUO => OEUO Tools/Utilities => Topic started by: TrailMyx on August 15, 2010, 11:55:32 AM

Title: Trailmyx's EUO to OEUO Menu Conversion
Post by: TrailMyx on August 15, 2010, 11:55:32 AM
---------------------------------------------------------------
-- Script Name: TrailMyx's LUA Subroutine Collection
-- Author: TrailMyx
-- Version: v3
-- Shard OSI / FS: unk
-- Revision Date: 9/29/2007
-- Purpose: Collection of routines, including:
--    Menu converter from EUO menu designer to OEUO native
--    Journal handler (like TM_Adv)
--    etc.
-- Requirements:
--
-- Special Thanks:
--
-- Beta testers:
-- Bug testers:
--
---------------------------------------------------------------

Current Version: v3.0
New to version 3.0:
New to version 2.1:

Todo:

This is a collection of LUA subs and a .NET converter program to take menu designer created menus and port them to native OEUO LUA code.  

The included .NET program will let you cut/paste EUO code into the top window and create LUA compatible code that can be parsed to create menus within your OEUO LUA script.

A button manager is included to automate your existing EUO buttons within the OEUO world!!

P.S. This is my first Lua script.  It's basically written; so please don't be too critical

Sample to get you started:

Code: [Select]
dofile("tm_subs_v30.lua")
-------------------------------------
-- Your functions
-------------------------------------
function EUOButton1()
  print("holy crap, it ran!")
end
-------------------------------------
function EUOButtonExit()
  Obj.Exit()
end
-------------------------------------
-- Your main script
-------------------------------------

mf = MenuInfo:New()

mf:TM_MenuFunction("sub showEUOMenu1")
mf:TM_MenuFunction("menu Clear")
mf:TM_MenuFunction("menu Window Title TrailMyx's SOS Autofarmer v , %version")
mf:TM_MenuFunction("menu Window Color Lime")
mf:TM_MenuFunction("menu Button EUOButton1 20 420 75 25 Totalize")
mf:TM_MenuFunction("menu Window Size 625 455")
mf:TM_MenuFunction("menu Show 421 270")

--mf:TM_DeleteControl("EUOButton1")
mf:TM_MenuFunction("menu Button EUOButtonExit 120 420 75 25 Exit")

Obj.Loop()
Obj.Free(mf.EUOMenu)
Title: Trailmyx's EUO to OEUO Menu Conversion Q/A
Post by: TrailMyx on August 15, 2010, 11:55:56 AM
reserved
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: TrailMyx on August 15, 2010, 12:30:49 PM
I'm probably going to keep these routines under development for a while.  I'm already learning more about the OOP aspect of Lua, so they might actually get reformatted a bit.  Sorry, but that's the breaks when I only have about 1 week of Lua training... ;)
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: TrailMyx on August 15, 2010, 09:48:30 PM
So I have somewhat re-written the converter to address the data structure I originally designed as a complete object, including embedding the necessary routines into the object.

So the example code looks more like this:

Code: [Select]
dofile("tm_subs_v30.lua")
-------------------------------------
-- Your functions
-------------------------------------
function EUOButton1()
  print("holy crap, it ran!")
end
-------------------------------------
-- Your main script
-------------------------------------

mf = MenuInfo:New()

mf:TM_MenuFunction("sub showEUOMenu1")
mf:TM_MenuFunction("menu Clear")
mf:TM_MenuFunction("menu Window Title TrailMyx's SOS Autofarmer v , %version")
mf:TM_MenuFunction("menu Window Color BtnFace")
mf:TM_MenuFunction("menu Button EUOButton1 20 420 75 25 Totalize")
mf:TM_MenuFunction("menu Window Size 625 455")
mf:TM_MenuFunction("menu Show 421 270")

mf:TM_DeleteControl("EUOButton1")

Obj.Loop()
Obj.Free(mf.EUOMenu)

For you, it's just a cosmetic change, but for me it makes more sense to organize all the associated object information.  I will update the converter with the changes.  I would hold off a day while I get that fixed.  I won't support the older syntax, so please update soon.
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: TrailMyx on August 16, 2010, 08:47:50 AM
Ok, I've updated the first post with the updated converter that makes the correct object information for the new object organization.
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: Masscre on August 16, 2010, 04:54:40 PM
More fluid structure now and that means more speed over all.
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: TrailMyx on August 16, 2010, 05:02:59 PM
Oh cool.  How did you change it?  Why is it better? :)


I just packaged the methods (routines) into the object (data).  But you'll see the syntax is a bit different.  Probably won't be much faster, but I'm happier about the organization of the data.
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: TrailMyx on August 19, 2010, 10:28:05 AM
I'm going to tweak the button handling a bit to link them to the containing object.  Right now, if you include more than one EUO menu, you might have the same button names (i.e. EUOButton1, etc.)  But if you reference the button to the containing object, you can have different buttons all named "EUOButton1" but can call unique functions for each menu. 

I'll post this tonight sometime after I do a bit of testing.
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: TrailMyx on August 19, 2010, 10:45:45 AM
With some example code right? :)


Of course; I always update my sample code.  The change for you is VERY minor.

My knowledge of Lua is still pretty darn basic, but what I'm putting out should be pretty useful for most people.  I still script OEUO like one might script EUO, so the stuff I produce won't melt your brain too much. 
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: TrailMyx on September 17, 2010, 08:04:21 PM
I've updated this to fix a little issue.  I'm going to be adding a bunch of stuff to this because I'm starting to uses these for my own purposes.
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: Superslayer on October 24, 2010, 04:53:56 AM
Busy?

Error: tm_subs_v31.lua:49: bad argument #2 to 'remove' (number expected, got table)

The example code calls version 30, not version 31. :P
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: TrailMyx on October 24, 2010, 11:19:34 AM
I have a whole new version of this I haven't posted yet.  I think I fixed that one.  I thought I posted that already.
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: TrailMyx on October 24, 2010, 03:27:07 PM
Ok, I updated to the latest version.  I switched to a numerical version system so you can verify compatibility by referencing the included global version number for this group of subs.  Sorry, the posted version was really old.  I didn't see anyone using these, so I didn't get excited to update.  This one has many fixes.  Note the name has changed, so you'll need to update your "dofile" reference.

Also, if you have problems with it, please post the "menu" command that's giving you issues so I can make sure it's not a corner case I haven't thought of yet.
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: Superslayer on October 24, 2010, 03:35:53 PM
Ack! Lime green ! :o

..continues to try out with burnt eye-balls!
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: Superslayer on October 24, 2010, 04:09:22 PM
error:
tm_menu_subs5.lua:78: attempt to index field 'EUOMenu' (a nil value)

Code: [Select]
dofile("tm_menu_subs5.lua")
-------------------------------------
-- Your functions
-------------------------------------
function EUOButton1()
  print("holy crap, it ran!")
end
-------------------------------------
function EUOButtonExit()
  Obj.Exit()
end
-------------------------------------
-- Your main script
-------------------------------------

mf = MenuInfo:New()
mf:TM_MenuFunction("menu Clear")
mf:TM_MenuFunction("menu Window Title test")  -- error occurs in this function
pause()
mf:TM_MenuFunction("menu Window Color Maroon")
mf:TM_MenuFunction("menu Window Size 420 230")
mf:TM_MenuFunction("menu Font Name MS Sans Serif")
mf:TM_MenuFunction("menu Font Size 8")
mf:TM_MenuFunction("menu Font BGColor Maroon")
mf:TM_MenuFunction("menu Shape Idoc_def_off_Outline 4 92 114 110 3 7 1 Black 7 Maroon")
mf:TM_MenuFunction("menu Shape TopOutline 4 4 413 84 3 7 1 Black 7 Maroon")
mf:TM_MenuFunction("menu Shape Script_Skill_Outline 172 8 241 73 3 7 1 Black 7 Maroon")
mf:TM_MenuFunction("menu Shape Control_Panel 8 8 53 76 3 7 1 Black 7 Maroon")
mf:TM_MenuFunction("menu Shape Checks_Outline 120 92 209 101 3 7 1 Black 7 Maroon")
mf:TM_MenuFunction("menu Shape Facet_Outline 4 206 413 22 3 7 1 Black 7 Maroon")
mf:TM_MenuFunction("menu Shape Skill_selection_box 310 12 97 21 3 7 1 Black 7 InactiveCaption")
mf:TM_MenuFunction("menu Shape MTM 66 63 100 21 3 7 1 Black 7 InactiveCaption")
mf:TM_MenuFunction("menu Shape Heal_selection_box 310 34 97 21 3 7 1 Black 7 InactiveCaption")
mf:TM_MenuFunction("menu Font Transparent #true")
mf:TM_MenuFunction("menu text _Hours")
mf:TM_MenuFunction("menu text _Mins")
mf:TM_MenuFunction("menu text Homecount 55 182 HmCnt:")
mf:TM_MenuFunction("menu text Homecount_result 90 182 %homecnt")
mf:TM_MenuFunction("menu text Structure_Status 12 136 Current House Status:")
mf:TM_MenuFunction("menu text Structure_Status2 20 151 %housestatus")
mf:TM_MenuFunction("menu text Idocs_Found 12 166 Idoc's:")
mf:TM_MenuFunction("menu text Idocs_result 46 166 %Idocsfound")
mf:TM_MenuFunction("menu text Grtly_Found 62 166 Grtly's:")
mf:TM_MenuFunction("menu text Grtly_result 96 166 %Grtlysfound")
mf:TM_MenuFunction("menu text Laps 12 182 Laps:")
mf:TM_MenuFunction("menu text Lap_status 38 182 %laps")
mf:TM_MenuFunction("menu Text Script_Status 180 60 Script Status:")
mf:TM_MenuFunction("menu Text Status_result 245 60 Awaiting Start Button")
mf:TM_MenuFunction("menu Text And_Or 96 34 And/Or")
mf:TM_MenuFunction("menu Text Search 12 210 Search facets:")
mf:TM_MenuFunction("menu Font Style u")
mf:TM_MenuFunction("menu Text Method_Travel_Text 74 6 Method of Travel")
mf:TM_MenuFunction("menu Font Name Book Antiqua")
mf:TM_MenuFunction("menu Font Style i")
mf:TM_MenuFunction("menu font color white")
mf:TM_MenuFunction("menu font bgcolor black")
mf:TM_MenuFunction("menu font bgcolor maroon")
mf:TM_MenuFunction("menu font color black")
mf:TM_MenuFunction("menu Font Style ; turns off italic")
mf:TM_MenuFunction("menu Font Align Right")
mf:TM_MenuFunction("menu Font Name MS Sans Serif")
mf:TM_MenuFunction("menu Check IslandCheck 125 96 97 13 #false Go To Islands ?")
mf:TM_MenuFunction("menu Check DeadCheck 125 116 97 13 #false Stay Dead ?")
mf:TM_MenuFunction("menu Check RunFlyCheck 125 136 97 13 #false Run/Fly ?")
mf:TM_MenuFunction("menu Check BoatCheck 125 156 97 13 #false Use a Boat ?")
mf:TM_MenuFunction("menu Check HRCheck 125 176 97 13 #false Home Roam ?")
mf:TM_MenuFunction("menu Check LoopScriptCheck 236 96 88 13 #false Loop Script ?")
mf:TM_MenuFunction("menu Check ChivalryCheck 80 19 65 17 #false Chivalry")
mf:TM_MenuFunction("menu Check Magery_Check 80 45 65 17 #false Magery")
mf:TM_MenuFunction("menu Check Skill_Check 180 16 95 13 #false Use a skill ?")
mf:TM_MenuFunction("menu Check Home 236 116 88 13 #false Home Secure")
mf:TM_MenuFunction("menu Check Bank 236 136 88 13 #false Bank Secure")
mf:TM_MenuFunction("menu Check Go_to_MSL 236 156 88 13 #false Go to MSL's")
mf:TM_MenuFunction("menu Check Make_MSL 236 176 88 13 #false Make MSL's")
mf:TM_MenuFunction("menu Check Heal_Check 180 35 95 13 #false Heal Method ?")
mf:TM_MenuFunction("menu Check Fel_Check 95 210 65 13 #false Felucca")
mf:TM_MenuFunction("menu Check Tram_Check 165 210 60 13 #false Trammel")
mf:TM_MenuFunction("menu Check Malas_Check 230 210 50 13 #false Malas")
mf:TM_MenuFunction("menu Check Tok_Check 285 210 60 13 #false Tokuno")
mf:TM_MenuFunction("menu Check TerM_Check 350 210 58 13 #false Ter Mer")
mf:TM_MenuFunction("menu Font Color White")
mf:TM_MenuFunction("menu Font BGColor Black")
mf:TM_MenuFunction("menu Button Erase_Log 12 118 100 18 Erase House File")
mf:TM_MenuFunction("menu Button Start_Button 12 12 45 21 Start")
mf:TM_MenuFunction("menu Button Pause_Button 12 36 45 21 Pause")
mf:TM_MenuFunction("menu Button Quit_Button 12 60 45 21 Quit")
mf:TM_MenuFunction("menu Button Load_Button 334 116 82 22 Load Profile")
mf:TM_MenuFunction("menu Button Save_Button 334 92 82 22 Save Profile")
mf:TM_MenuFunction("menu Button Reset_Button 334 140 82 22 Reset Profile")
mf:TM_MenuFunction("menu Edit Username 12 96 99 %username")
mf:TM_MenuFunction("menu Font Align left")
mf:TM_MenuFunction("menu Show 275 675")


Obj.Loop()
Obj.Free(mf.EUOMenu)
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: TrailMyx on October 24, 2010, 04:29:05 PM
You need to include the WHOLE mess of information that comes from the Menu designer, INCLUDING the subroutine name, because my Lua subs use the sub name to describe each menu object instance.  So just add the line: 

"sub euoMenu1" to the top of your menu reconstruction.
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: Superslayer on October 24, 2010, 04:45:35 PM
Gotchya, didn't realize the whole sub was needed. After the conversion, I get the following error when doing the text part:

lua:136 ERR_WRONGPAR

Commenting my menu text block out, the script continues just fine and creates the menu.
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: TrailMyx on October 24, 2010, 04:51:29 PM
Looks like you have some syntax errors in your menu stuff.  Remember, this is meant for stuff generated with the menu designer.  I can see you have hand-massaged your menu a bit.

Perhaps try loading this back into the menu designer, and have it re-generate the menu for you.
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: Superslayer on October 24, 2010, 05:03:22 PM
I did change the menu with what I posted above, but only took out an 'if' statement from it. My original menu consisted of 2 conditions and depending on that, a different menu was generated. Here's what I'm using now:

Code: [Select]
dofile("tm_menu_subs5.lua")
-------------------------------------
-- Your functions
-------------------------------------
function EUOButton1()
  print("holy crap, it ran!")
end
-------------------------------------
function EUOButtonExit()
  Obj.Exit()
end
-------------------------------------
-- Your main script
-------------------------------------

mf = MenuInfo:New()
mf:TM_MenuFunction("Sub SS_Menu") 
mf:TM_MenuFunction("menu Clear")
mf:TM_MenuFunction("menu Window Title TEST Running")
mf:TM_MenuFunction("menu Window Color Maroon")
mf:TM_MenuFunction("menu Window Size 420 230")
mf:TM_MenuFunction("menu Font Name MS Sans Serif")
mf:TM_MenuFunction("menu Font Size 8")
mf:TM_MenuFunction("menu Font BGColor Maroon")
mf:TM_MenuFunction("menu Shape Idoc_def_off_Outline 4 92 114 110 3 7 1 Black 7 Maroon")
mf:TM_MenuFunction("menu Shape TopOutline 4 4 413 84 3 7 1 Black 7 Maroon")
mf:TM_MenuFunction("menu Shape Script_Skill_Outline 172 8 241 73 3 7 1 Black 7 Maroon")
mf:TM_MenuFunction("menu Shape Control_Panel 8 8 53 76 3 7 1 Black 7 Maroon")
mf:TM_MenuFunction("menu Shape Checks_Outline 120 92 209 101 3 7 1 Black 7 Maroon")
mf:TM_MenuFunction("menu Shape Facet_Outline 4 206 413 22 3 7 1 Black 7 Maroon")
mf:TM_MenuFunction("menu Shape Skill_selection_box 310 12 97 21 3 7 1 Black 7 Green")
mf:TM_MenuFunction("menu Shape MTM 66 63 100 21 3 7 1 Black 7 Green")
mf:TM_MenuFunction("menu Shape Heal_selection_box 310 34 97 21 3 7 1 Black 7 Green")
mf:TM_MenuFunction("menu Font Transparent #true")
         
mf:TM_MenuFunction("menu text Hours")
mf:TM_MenuFunction("menu text Mins")
mf:TM_MenuFunction("menu text Homecount 55 182 HmCnt:")
mf:TM_MenuFunction("menu text Homecount_result 90 182 %homecnt")
mf:TM_MenuFunction("menu text Structure_Status 12 136 Current House Status:")
mf:TM_MenuFunction("menu text Structure_Status2 20 151 %housestatus")
mf:TM_MenuFunction("menu text Idocs_Found 12 166 Idoc's:")
mf:TM_MenuFunction("menu text Idocs_result 46 166 %Idocsfound")
mf:TM_MenuFunction("menu text Grtly_Found 62 166 Grtly's:")
mf:TM_MenuFunction("menu text Grtly_result 96 166 %Grtlysfound")
mf:TM_MenuFunction("menu text Laps 12 182 Laps:")
mf:TM_MenuFunction("menu text Lap_status 38 182 %laps")
mf:TM_MenuFunction("menu Text Script_Status 180 60 Script Status:")
mf:TM_MenuFunction("menu Text Status_result 245 60 Awaiting Start Button")
mf:TM_MenuFunction("menu Text And_Or 96 34 And/Or")
mf:TM_MenuFunction("menu Text Search 12 210 Search facets:")
                         
mf:TM_MenuFunction("menu Font Style u")
mf:TM_MenuFunction("menu Text Method_Travel_Text 74 6 Method of Travel")
mf:TM_MenuFunction("menu Font Name Book Antiqua")
mf:TM_MenuFunction("menu Font Style i")
mf:TM_MenuFunction("menu font color white")
mf:TM_MenuFunction("menu font bgcolor black")
mf:TM_MenuFunction("menu font bgcolor maroon")
mf:TM_MenuFunction("menu font color black")
mf:TM_MenuFunction("menu Font Style")
mf:TM_MenuFunction("menu Font Align Right")
mf:TM_MenuFunction("menu Font Name MS Sans Serif")
mf:TM_MenuFunction("menu Check IslandCheck 125 96 97 13 #false Go To Islands ?")
mf:TM_MenuFunction("menu Check DeadCheck 125 116 97 13 #false Stay Dead ?")
mf:TM_MenuFunction("menu Check RunFlyCheck 125 136 97 13 #false Run/Fly ?")
mf:TM_MenuFunction("menu Check BoatCheck 125 156 97 13 #false Use a Boat ?")
mf:TM_MenuFunction("menu Check HRCheck 125 176 97 13 #false Home Roam ?")
mf:TM_MenuFunction("menu Check LoopScriptCheck 236 96 88 13 #false Loop Script ?")
mf:TM_MenuFunction("menu Check ChivalryCheck 80 19 65 17 #false Chivalry")
mf:TM_MenuFunction("menu Check Magery_Check 80 45 65 17 #false Magery")
mf:TM_MenuFunction("menu Check Skill_Check 180 16 95 13 #false Use a skill ?")
mf:TM_MenuFunction("menu Check Home 236 116 88 13 #false Home Secure")
mf:TM_MenuFunction("menu Check Bank 236 136 88 13 #false Bank Secure")
mf:TM_MenuFunction("menu Check Go_to_MSL 236 156 88 13 #false Go to MSL's")
mf:TM_MenuFunction("menu Check Make_MSL 236 176 88 13 #false Make MSL's")
mf:TM_MenuFunction("menu Check Heal_Check 180 35 95 13 #false Heal Method ?")
mf:TM_MenuFunction("menu Check Fel_Check 95 210 65 13 #false Felucca")
mf:TM_MenuFunction("menu Check Tram_Check 165 210 60 13 #false Trammel")
mf:TM_MenuFunction("menu Check Malas_Check 230 210 50 13 #false Malas")
mf:TM_MenuFunction("menu Check Tok_Check 285 210 60 13 #false Tokuno")
mf:TM_MenuFunction("menu Check TerM_Check 350 210 58 13 #false Ter Mer")
mf:TM_MenuFunction("menu Font Color White")
mf:TM_MenuFunction("menu Font BGColor Black")
mf:TM_MenuFunction("menu Button Erase_Log 12 118 100 18 Erase House File")
mf:TM_MenuFunction("menu Button Start_Button 12 12 45 21 Start")
mf:TM_MenuFunction("menu Button Pause_Button 12 36 45 21 Pause")
mf:TM_MenuFunction("menu Button Quit_Button 12 60 45 21 Quit")
mf:TM_MenuFunction("menu Button Load_Button 334 116 82 22 Load Profile")
mf:TM_MenuFunction("menu Button Save_Button 334 92 82 22 Save Profile")
mf:TM_MenuFunction("menu Button Reset_Button 334 140 82 22 Reset Profile")
mf:TM_MenuFunction("menu Edit Username 12 96 99 %username")
mf:TM_MenuFunction("menu Font Align left")
mf:TM_MenuFunction("menu Show 275 675")
mf:TM_MenuFunction("set #menubutton N/A")
mf:TM_MenuFunction("Return")   
Obj.Loop()
Obj.Free(mf.EUOMenu)
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: TrailMyx on October 24, 2010, 05:06:41 PM
You'll have to step through it, but it's things like this that'll mess up the Lua stuff because the syntax is not correct:

Code: [Select]
mf:TM_MenuFunction("menu text Hours")
mf:TM_MenuFunction("menu text Mins")
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: Superslayer on October 24, 2010, 05:15:44 PM
Ah, I see that, for some reason I had that in the original script and forgot to remove it. Commenting it out when running this menu converting script solved my issue. Thanks for this, and sorry for my incompetence :-[.

On another note, I did end up changing my arg for "InactiveCaption" to another color, green. Script didn't recognize that parameter. Also, I'm sure you're aware, "Image" is a function that euo used, not sure of the oeuo parallel, if there is one. I just removed it from my script.
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: TrailMyx on October 24, 2010, 05:21:48 PM
No worries, that's why I kinda predicated the need for the code to be generated by the menu designer.  Every menu I've manipulated by hand will also kill these subs, so I'm in your same boat.  ;)

For whatever color you come up with, let me know about it so I can add it to the master color list.  There is no 1:1 correlation between what was done in EUO and what was done for Objects.dll, so I had to reconstruct everything you see in my subs by hand.  Right now, I just have the basic colors covered.

For the image, cheffe doesn't have that functionality yet, so I couldn't add that.  Or at least I couldn't figure it out yet.  In any event, I plan on adding it, so you should just comment those lines out in your code until that command gets some support.

That's part of the reason why I've kinda given OEUO a break because there are lots of little things missing.  I'll get back to it once things start looking a bit more official.
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: TrailMyx on October 24, 2010, 05:31:08 PM
Did you click your buttons yet?  You'll see how easy it is to automate your script since the button handlers are just functions with the same names as your buttons.  Easy-peasy.
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: Superslayer on October 24, 2010, 05:40:41 PM
I did go ahead and make a bunch of button handlers. Start, pause, load, etc..., using print to verify. I haven't associated an actual function/action to them, but I did notice that ifI were to press the "X" in the top right of the menu, near the minimize, maximize buttons, I do get another error. Can that be controled/associated with a created button like Quit or End script?

The error message says: lua:381: ERR_INVALIDOBJECT

I think it would be smart to associate that to a created 'quit script' button by the user and if possible, disable closing that ability if a button didn't exist. Or is that something inside of OEUO that Cheffe will eventually have to address?
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: TrailMyx on October 24, 2010, 05:46:37 PM
There's no way to associate that.  I think that problem will fix itself when cheffe allows for the 2nd thread to control all the menu stuff and can perform a proper clean up upon exit.  For now, it's just easier to have a button that stops the script so the objects can be destroyed, or press the OEUO stop button 2 times.
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: Superslayer on October 24, 2010, 05:55:16 PM
Figured, no biggie.

As for color stuff, I notice that cream and btnface look like white, as well as lime green looks like green. I personally don't care, but if your converter script comes across an 'Inactivecaption' , best bet would probably set it to the color gray or btnface. Just an observation.
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: TrailMyx on October 24, 2010, 06:00:29 PM
I'll make sure to change that when I make the next release.  It's easy when I don't have to compute a new color, but rather re-use and existing one.  ;)
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: Crome969 on August 19, 2011, 01:01:47 PM
Is this Project still active?
i tested today to convert and use a Menu for OpenUO.
I used Menudesigner in Easyuo and Convertet it to OpenUO.

Easyuo:
Code: [Select]
;--------- EasyUO Menu Designer Code Begin ---------
sub showEUOMenu1
menu Clear
menu Window Title Heartwood Tinker Quest Maker
menu Window Color InfoBk
menu Window Size 352 280
menu Font Transparent #true
menu Font Align Right
menu Font Name MS Sans Serif
menu Font Size 8
menu Font Style
menu Font Color WindowText
menu Font BGColor Window
menu List Create RunicNames 22 32 124 121
menu List Add RunicNames Iron Tinker Runic
menu List Add RunicNames Dull Copper Runic
menu List Add RunicNames Shadow Tinker Runic
menu List Add RunicNames Copper Tinker Runic
menu List Add RunicNames Bronze Tinker Runic
menu List Add RunicNames Gold Tinker Runic
menu List Add RunicNames Agapite Tinker Runic
menu List Add RunicNames Verite Tinker Runic
menu List Add RunicNames Valorite Tinker Runic
menu Font Name MS Sans Serif
menu Font Size 8
menu Font Style
menu Font Color WindowText
menu List Create RunicUses 146 32 45 121
menu List Add RunicUses 0
menu List Add RunicUses 0
menu List Add RunicUses 0
menu List Add RunicUses 0
menu List Add RunicUses 0
menu List Add RunicUses 0
menu List Add RunicUses 0
menu List Add RunicUses 0
menu List Add RunicUses 0
menu Font Name MS Sans Serif
menu Font Size 8
menu Font Style
menu Font Color WindowText
menu List Create RName 22 16 124 17
menu List Add RName Runics
menu Font Name MS Sans Serif
menu Font Size 8
menu Font Style
menu Font Color WindowText
menu List Create RUses 146 16 45 17
menu List Add RUses Amount
menu Font Name MS Sans Serif
menu Font Size 8
menu Font Style
menu Font Color WindowText
menu List Create Recipes 22 181 124 57
menu List Add Recipes Pendant of Magi
menu List Add Recipes Scrappers Compendium
menu List Add Recipes Essence of Battle
menu List Add Recipes Resilient Bracer
menu Font Name MS Sans Serif
menu Font Size 8
menu Font Style
menu Font Color WindowText
menu List Create RecipeAmount2 146 181 45 57
menu List Add RecipeAmount2 0
menu List Add RecipeAmount2 0
menu List Add RecipeAmount2 0
menu List Add RecipeAmount2 0
menu Font Name MS Sans Serif
menu Font Size 8
menu Font Style
menu Font Color WindowText
menu List Create RecipeName 22 165 124 17
menu List Add RecipeName Recipe
menu Font Name MS Sans Serif
menu Font Size 8
menu Font Style
menu Font Color WindowText
menu List Create RecipeAmount 146 165 45 17
menu List Add RecipeAmount Amount
menu Font Name MS Sans Serif
menu Font Size 8
menu Font Style
menu Font Color WindowText
menu List Create TName 22 249 102 17
menu List Add TName Time elapsed :
menu Font Name MS Sans Serif
menu Font Size 8
menu Font Style
menu Font Color WindowText
menu List Create EUOListBox2 124 249 67 17
menu List Add EUOListBox2 00 : 00 : 00
menu Font Name MS Sans Serif
menu Font Size 8
menu Font Style
menu Font Color WindowText
menu List Create QName 22 265 102 17
menu List Add QName Quest Turns Done
menu Font Name MS Sans Serif
menu Font Size 8
menu Font Style
menu Font Color WindowText
menu List Create EUOListBox3 124 265 67 17
menu List Add EUOListBox3 00
menu Font Name MS Sans Serif
menu Font Size 8
menu Font Style
menu Font Color WindowText
menu Font Align Left
menu Font BGColor InfoBk
menu Check EUOCheckBox1 220 36 119 25 #false Extraordinary
menu Font BGColor Window
menu List Create EUOListBox1 220 20 124 17
menu List Add EUOListBox1 Loot Level :
menu Font BGColor InfoBk
menu Check EUOCheckBox2 220 56 119 25 #false Magnificient
menu Check EUOCheckBox3 220 76 119 25 #false Extraordinary
menu Check EUOCheckBox4 220 96 119 25 #false Satisfactory
menu Check Typical 220 116 119 25 #false Typical
menu Font BGColor BtnFace
menu Button Start 220 256 125 25 Start
menu Font BGColor Window
menu List Create EUOListBox4 220 180 80 69
menu List Add EUOListBox4 Extraordinary
menu List Add EUOListBox4 Magnificient
menu List Add EUOListBox4 Superb
menu List Add EUOListBox4 Satisfactory
menu List Add EUOListBox4 Typical
menu List Create EUOListBox5 300 180 45 69
menu List Add EUOListBox5 0
menu List Add EUOListBox5 0
menu List Add EUOListBox5 0
menu List Add EUOListBox5 0
menu List Add EUOListBox5 0
menu List Create EUOListBox6 220 164 80 17
menu List Add EUOListBox6 Items Looted
menu List Create EUOListBox7 300 164 45 17
menu List Add EUOListBox7 Amount
menu Show 421 270
return
;--------- EasyUO Menu Designer Code End ---------

Openuo Convertet:

Code: [Select]
Crome = MenuInfo:New()
Crome:TM_MenuFunction("menu Clear")
Crome:TM_MenuFunction("menu Window Title Heartwood Tinker Quest Maker")
Crome:TM_MenuFunction("menu Window Color InfoBk")
Crome:TM_MenuFunction("menu Window Size 352 280")
Crome:TM_MenuFunction("menu Font Transparent #true")
Crome:TM_MenuFunction("menu Font Align Right")
Crome:TM_MenuFunction("menu Font Name MS Sans Serif")
Crome:TM_MenuFunction("menu Font Size 8")
Crome:TM_MenuFunction("menu Font Style ")
Crome:TM_MenuFunction("menu Font Color WindowText")
Crome:TM_MenuFunction("menu Font BGColor Window")
Crome:TM_MenuFunction("menu List Create RunicNames 22 32 124 121")
Crome:TM_MenuFunction("menu List Add RunicNames Iron Tinker Runic")
Crome:TM_MenuFunction("menu List Add RunicNames Dull Copper Runic")
Crome:TM_MenuFunction("menu List Add RunicNames Shadow Tinker Runic")
Crome:TM_MenuFunction("menu List Add RunicNames Copper Tinker Runic")
Crome:TM_MenuFunction("menu List Add RunicNames Bronze Tinker Runic")
Crome:TM_MenuFunction("menu List Add RunicNames Gold Tinker Runic")
Crome:TM_MenuFunction("menu List Add RunicNames Agapite Tinker Runic")
Crome:TM_MenuFunction("menu List Add RunicNames Verite Tinker Runic")
Crome:TM_MenuFunction("menu List Add RunicNames Valorite Tinker Runic")
Crome:TM_MenuFunction("menu Font Name MS Sans Serif")
Crome:TM_MenuFunction("menu Font Size 8")
Crome:TM_MenuFunction("menu Font Style ")
Crome:TM_MenuFunction("menu Font Color WindowText")
Crome:TM_MenuFunction("menu List Create RunicUses 146 32 45 121")
Crome:TM_MenuFunction("menu List Add RunicUses 0")
Crome:TM_MenuFunction("menu List Add RunicUses 0")
Crome:TM_MenuFunction("menu List Add RunicUses 0")
Crome:TM_MenuFunction("menu List Add RunicUses 0")
Crome:TM_MenuFunction("menu List Add RunicUses 0")
Crome:TM_MenuFunction("menu List Add RunicUses 0")
Crome:TM_MenuFunction("menu List Add RunicUses 0")
Crome:TM_MenuFunction("menu List Add RunicUses 0")
Crome:TM_MenuFunction("menu List Add RunicUses 0")
Crome:TM_MenuFunction("menu Font Name MS Sans Serif")
Crome:TM_MenuFunction("menu Font Size 8")
Crome:TM_MenuFunction("menu Font Style ")
Crome:TM_MenuFunction("menu Font Color WindowText")
Crome:TM_MenuFunction("menu List Create RName 22 16 124 17")
Crome:TM_MenuFunction("menu List Add RName Runics")
Crome:TM_MenuFunction("menu Font Name MS Sans Serif")
Crome:TM_MenuFunction("menu Font Size 8")
Crome:TM_MenuFunction("menu Font Style ")
Crome:TM_MenuFunction("menu Font Color WindowText")
Crome:TM_MenuFunction("menu List Create RUses 146 16 45 17")
Crome:TM_MenuFunction("menu List Add RUses Amount")
Crome:TM_MenuFunction("menu Font Name MS Sans Serif")
Crome:TM_MenuFunction("menu Font Size 8")
Crome:TM_MenuFunction("menu Font Style ")
Crome:TM_MenuFunction("menu Font Color WindowText")
Crome:TM_MenuFunction("menu List Create Recipes 22 181 124 57")
Crome:TM_MenuFunction("menu List Add Recipes Pendant of Magi")
Crome:TM_MenuFunction("menu List Add Recipes Scrappers Compendium")
Crome:TM_MenuFunction("menu List Add Recipes Essence of Battle")
Crome:TM_MenuFunction("menu List Add Recipes Resilient Bracer")
Crome:TM_MenuFunction("menu Font Name MS Sans Serif")
Crome:TM_MenuFunction("menu Font Size 8")
Crome:TM_MenuFunction("menu Font Style ")
Crome:TM_MenuFunction("menu Font Color WindowText")
Crome:TM_MenuFunction("menu List Create RecipeAmount2 146 181 45 57")
Crome:TM_MenuFunction("menu List Add RecipeAmount2 0")
Crome:TM_MenuFunction("menu List Add RecipeAmount2 0")
Crome:TM_MenuFunction("menu List Add RecipeAmount2 0")
Crome:TM_MenuFunction("menu List Add RecipeAmount2 0")
Crome:TM_MenuFunction("menu Font Name MS Sans Serif")
Crome:TM_MenuFunction("menu Font Size 8")
Crome:TM_MenuFunction("menu Font Style ")
Crome:TM_MenuFunction("menu Font Color WindowText")
Crome:TM_MenuFunction("menu List Create RecipeName 22 165 124 17")
Crome:TM_MenuFunction("menu List Add RecipeName Recipe")
Crome:TM_MenuFunction("menu Font Name MS Sans Serif")
Crome:TM_MenuFunction("menu Font Size 8")
Crome:TM_MenuFunction("menu Font Style ")
Crome:TM_MenuFunction("menu Font Color WindowText")
Crome:TM_MenuFunction("menu List Create RecipeAmount 146 165 45 17")
Crome:TM_MenuFunction("menu List Add RecipeAmount Amount")
Crome:TM_MenuFunction("menu Font Name MS Sans Serif")
Crome:TM_MenuFunction("menu Font Size 8")
Crome:TM_MenuFunction("menu Font Style ")
Crome:TM_MenuFunction("menu Font Color WindowText")
Crome:TM_MenuFunction("menu List Create TName 22 249 102 17")
Crome:TM_MenuFunction("menu List Add TName Time elapsed :")
Crome:TM_MenuFunction("menu Font Name MS Sans Serif")
Crome:TM_MenuFunction("menu Font Size 8")
Crome:TM_MenuFunction("menu Font Style ")
Crome:TM_MenuFunction("menu Font Color WindowText")
Crome:TM_MenuFunction("menu List Create EUOListBox2 124 249 67 17")
Crome:TM_MenuFunction("menu List Add EUOListBox2 00 : 00 : 00")
Crome:TM_MenuFunction("menu Font Name MS Sans Serif")
Crome:TM_MenuFunction("menu Font Size 8")
Crome:TM_MenuFunction("menu Font Style ")
Crome:TM_MenuFunction("menu Font Color WindowText")
Crome:TM_MenuFunction("menu List Create QName 22 265 102 17")
Crome:TM_MenuFunction("menu List Add QName Quest Turns Done")
Crome:TM_MenuFunction("menu Font Name MS Sans Serif")
Crome:TM_MenuFunction("menu Font Size 8")
Crome:TM_MenuFunction("menu Font Style ")
Crome:TM_MenuFunction("menu Font Color WindowText")
Crome:TM_MenuFunction("menu List Create EUOListBox3 124 265 67 17")
Crome:TM_MenuFunction("menu List Add EUOListBox3 00")
Crome:TM_MenuFunction("menu Font Name MS Sans Serif")
Crome:TM_MenuFunction("menu Font Size 8")
Crome:TM_MenuFunction("menu Font Style ")
Crome:TM_MenuFunction("menu Font Color WindowText")
Crome:TM_MenuFunction("menu Font Align Left")
Crome:TM_MenuFunction("menu Font BGColor InfoBk")
Crome:TM_MenuFunction("menu Check EUOCheckBox1 220 36 119 25 #false Extraordinary")
Crome:TM_MenuFunction("menu Font BGColor Window")
Crome:TM_MenuFunction("menu List Create EUOListBox1 220 20 124 17")
Crome:TM_MenuFunction("menu List Add EUOListBox1 Loot Level :")
Crome:TM_MenuFunction("menu Font BGColor InfoBk")
Crome:TM_MenuFunction("menu Check EUOCheckBox2 220 56 119 25 #false Magnificient")
Crome:TM_MenuFunction("menu Check EUOCheckBox3 220 76 119 25 #false Extraordinary")
Crome:TM_MenuFunction("menu Check EUOCheckBox4 220 96 119 25 #false Satisfactory")
Crome:TM_MenuFunction("menu Check Typical 220 116 119 25 #false Typical")
Crome:TM_MenuFunction("menu Font BGColor BtnFace")
Crome:TM_MenuFunction("menu Button StartButton 220 256 125 25 Start")
Crome:TM_MenuFunction("menu Font BGColor Window")
Crome:TM_MenuFunction("menu List Create EUOListBox4 220 180 80 69")
Crome:TM_MenuFunction("menu List Add EUOListBox4 Extraordinary")
Crome:TM_MenuFunction("menu List Add EUOListBox4 Magnificient")
Crome:TM_MenuFunction("menu List Add EUOListBox4 Superb")
Crome:TM_MenuFunction("menu List Add EUOListBox4 Satisfactory")
Crome:TM_MenuFunction("menu List Add EUOListBox4 Typical")
Crome:TM_MenuFunction("menu List Create EUOListBox5 300 180 45 69")
Crome:TM_MenuFunction("menu List Add EUOListBox5 0")
Crome:TM_MenuFunction("menu List Add EUOListBox5 0")
Crome:TM_MenuFunction("menu List Add EUOListBox5 0")
Crome:TM_MenuFunction("menu List Add EUOListBox5 0")
Crome:TM_MenuFunction("menu List Add EUOListBox5 0")
Crome:TM_MenuFunction("menu List Create EUOListBox6 220 164 80 17")
Crome:TM_MenuFunction("menu List Add EUOListBox6 Items Looted")
Crome:TM_MenuFunction("menu List Create EUOListBox7 300 164 45 17")
Crome:TM_MenuFunction("menu List Add EUOListBox7 Amount")
Crome:TM_MenuFunction("menu Show 421 270")
Obj.Loop()
Obj.Free(mf.EUOMenu)
end
function StartButton()
print("holy crap, it ran!")
end

Error Code:
Code: [Select]
..\openuo\bibliothek\tm_menu_subs5.lua:78: attempt to index field 'EUOMenu' (a nil value)

Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: TrailMyx on August 19, 2011, 09:04:34 PM
You can probably get rid of the line "Obj.Free(mf.EUOMenu)", or change it to "Obj.Free(Crome.EUOMenu)".  Frankly, since I wrote all my initial Lua offerings, I've pretty much forgotten how to code in Lua.  lol

Anyhow, this project will get some love once Cheffe can get his objects.dll stuff up and running.  It was this code that demonstrated to me how many problems there was behind the scenes with the OEUO GUI stuff, so I just shelved it.  I'll certainly get back to it once things take off again.

When I get back into town (currently in Las Vegas) I'll check and see if I have a newer version of this scripting tool.
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: RcCluster on December 13, 2012, 01:30:11 PM
Current Version: v3.0
Am I blind? How can I download your script?

Thanks
RcCluster
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: TrailMyx on December 13, 2012, 01:54:55 PM
Restricted status members cannot see attachments.  Have a look at the site rules to see how to get unrestricted.  :)
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: Crome969 on December 13, 2012, 10:17:45 PM
Current Version: v3.0
Am I blind? How can I download your script?

Thanks
RcCluster
RcCluster from easyuo? Wasnt you supposed to be german speaking?
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: RcCluster on December 14, 2012, 08:43:53 AM
Current Version: v3.0
Am I blind? How can I download your script?

Thanks
RcCluster
RcCluster from easyuo? Wasnt you supposed to be german speaking?
ja right. but i'm new here ;) and have absolutely no idea what's going on! why is there no download link or some other clue?

thanks
RcCluster
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: Crome969 on December 14, 2012, 09:28:56 AM
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: TrailMyx on December 14, 2012, 09:38:06 AM
derka derka back at ya!
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: Crome969 on December 14, 2012, 10:49:47 AM
derka derka back at ya!
Does i need to understand this?:)
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: RcCluster on December 14, 2012, 12:40:07 PM
Title: Re: Trailmyx's EUO to OEUO Menu Conversion
Post by: gimlet on December 14, 2012, 01:06:35 PM
Waits for the ban hammer to fall!