Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - TrailMyx

Pages: 1 ... 614 615 [616] 617 618 ... 621
9226
Off Topic / Re: Bored at Work so thought i would post....
« on: June 12, 2008, 12:27:41 PM »
Heh, boredom sucks don't it.  Oh, thing that in a few more hours you'll be home and everything will be ok.  ;)

There aren't many members here either; but that's ok with me.

9227
Scripting Chat / Finally have some script explanations re-posted
« on: June 11, 2008, 11:32:35 PM »
Freddy graciously let me prowl through his thread vault over at WinUO.org and I was able to copy several of the script explanations from over there to add them to my scripts here.  So thanks to freddy for that!

TM

9228
Script Snippets / Context menu handler subs
« on: June 11, 2008, 10:57:41 PM »
Here's a set of subs I put together that will search the text of the context popup menu (exevent popup) and select the proper item.  I have searched the land to find most of the context menu entries, but I probably have forgotten a few, so if you find one, let me know and I'll add it to the master list.  This is independent of any OCR program out there, so you won't have any code dependencies.

Note:
You have to run SetupContextValues at the beginning of your scripts execution to setup all the %CONTEXT_XXX.. values.

Also, since this uses pixcol you must keep the screen clear of clutter, otherwise the script will claim it can't find the requested context line.

Here's a bit of test code:
Code: easyuo
  1. gosub SetupContextValues
  2. set #TARGCURS 1
  3. repeat
  4. until #TARGCURS = 0
  5. gosub HandleContextMenu NULL #LTARGETID %CONTEXT_Buy ; "Vender buy!"
  6.  

Also, this has been setup so you may call it as a separate subroutine:
Code: easyuo
  1. set %context_subs c:\context_subs.txt
  2.  
  3. call %context_subs SetupContextValues
  4. call %context_subs HandleContextMenu #CHARID %CONTEXT_Open_Paperdoll
  5.  

Here's the code you'll need to include in your script:

If you add it directly, then you don't need the "gosub %1" and "exit".  Those are there to allow these subs to be "call"ed.
Code: easyuo
  1. gosub %1
  2. exit
  3. ;-------------------------------------------------------------------------------
  4. sub SetupContextValues
  5. ; For #CHARID -------------------------------------------
  6.   set %CONTEXT_Open_Paperdoll 3156756
  7.   set %CONTEXT_Open_Backpack 3428334
  8.   set %CONTEXT_View_Quest_Log 3126406
  9.   set %CONTEXT_Quest_Conversation 3730488
  10.   set %CONTEXT_Cancel_Quest 1535584
  11.   set %CONTEXT_Toggle_Insurance 6427264
  12.   set %CONTEXT_Auto_Renew_Insurance 10565554
  13.   set %CONTEXT_Cancel_Renewing 8578676
  14.   set %CONTEXT_Toggle_Monster_Title_Display 6959492
  15.   set %CONTEXT_Toggle_Quest_Item 3603586
  16.   set %CONTEXT_Leave_House 2202616
  17.   set %CONTEXT_Totals 744812 ; alexandria
  18. ; -------------------------------------------------------
  19. ; Various commands:
  20.   set %CONTEXT_Buy 200250
  21.   set %CONTEXT_Sell 260988
  22.   set %CONTEXT_Open_Bankbox 2793788
  23.   set %CONTEXT_Talk 208296
  24.   set %CONTEXT_Stable_Pet 1059800
  25.   set %CONTEXT_Claim_All_Pets 3073470
  26.   set %CONTEXT_Ask_Destination 4153934
  27.   set %CONTEXT_Accept_Escort 2171844
  28.   set %CONTEXT_Command_Kill 3025036
  29.   set %CONTEXT_Command_Follow 2998872
  30.   set %CONTEXT_Command_Guard 3695576
  31.   set %CONTEXT_Command_Stop 3084560
  32.   set %CONTEXT_Command_Stay 3438018
  33.   set %CONTEXT_Add_Friend 1757318
  34.   set %CONTEXT_Remove_Friend 2870250
  35.   set %CONTEXT_Transfer 593758
  36.   set %CONTEXT_Release 753348
  37.   set %CONTEXT_Tame 2967380
  38.   set %CONTEXT_Hire 271802
  39.   set %CONTEXT_Lock_Karma 1628904
  40.   set %CONTEXT_Tithe_Gold 1504152
  41.   set %CONTEXT_Resurrect 1040922
  42.   set %CONTEXT_Add_To_Spellbook 4435612
  43.  
  44. ; -------------------------------------------------------
  45. ; Training commands:
  46.   set %CONTEXT_Train_Alchemy 2851050
  47.   set %CONTEXT_Train_Anatomy 2802984
  48.   set %CONTEXT_Train_Animal_Taming 4605822
  49.   set %CONTEXT_Train_Animal_Lore 3779370
  50.   set %CONTEXT_Train_Archery 2127964
  51.   set %CONTEXT_Train_Arms_Lore 2746638
  52.   set %CONTEXT_Train_Blacksmithy 5406112
  53.   set %CONTEXT_Train_Bowcraft_Fletching 9229098
  54.   set %CONTEXT_Train_Camping 3103050
  55.   set %CONTEXT_Train_Carpentry 3895634
  56.   set %CONTEXT_Train_Cartography 4174618
  57.   set %CONTEXT_Train_Chivalry 3031212
  58.   set %CONTEXT_Train_Cooking 2505550
  59.   set %CONTEXT_Train_Discordance 4510014
  60.   set %CONTEXT_Train_Evaluating_Intelligence 10255594
  61.   set %CONTEXT_Train_Fencing 2057938
  62.   set %CONTEXT_Train_Fishing 2129530
  63.   set %CONTEXT_Train_Focus 1736784
  64.   set %CONTEXT_Train_Forensic_Evaluation 9881992
  65.   set %CONTEXT_Train_Healing 2330106
  66.   set %CONTEXT_Train_Inscription 2652544
  67.   set %CONTEXT_Train_Item_Identification 10238832
  68.   set %CONTEXT_Train_Lockpicking 3681790
  69.   set %CONTEXT_Train_Lumberjacking 6315420
  70.   set %CONTEXT_Train_Mace_Fighting 5961428
  71.   set %CONTEXT_Train_Magery 2466304
  72.   set %CONTEXT_Train_Meditation 3901812
  73.   set %CONTEXT_Train_Mining 2019092
  74.   set %CONTEXT_Train_Musicianship 4167920
  75.   set %CONTEXT_Train_Necromancy 4205298
  76.   set %CONTEXT_Train_Parry 3108898
  77.   set %CONTEXT_Train_Peacemaking 4680400
  78.   set %CONTEXT_Train_Provocation 3850930
  79.   set %CONTEXT_Train_Resisting_Spells 6022522
  80.   set %CONTEXT_Train_Spirit_Speak 4945928
  81.   set %CONTEXT_Train_Swordsmanship 5601890
  82.   set %CONTEXT_Train_Tactics 1806400
  83.   set %CONTEXT_Train_Tailoring 2867278
  84.   set %CONTEXT_Train_Taste_Evaluation 6613220
  85.   set %CONTEXT_Train_Tinkering 2863750
  86.   set %CONTEXT_Train_Tracking 2572028
  87.   set %CONTEXT_Train_Veterinary 2777822
  88.   set %CONTEXT_Train_Wrestling 2967380
  89. return
  90. ;-------------------------------------------------------------------------------
  91. ; %1 = HandleContextMenu
  92. ; %2 = #FINDID to manipulate
  93. ; %3 = menu selection
  94. ; returns #TRUE if entry not found, otherwise #FALSE for no error
  95. ; stores computed values in !test1, !test2, !test3, etc for each menu selection.
  96. sub HandleContextMenu
  97.   namespace push
  98.   namespace local HCM
  99.   set !findid %2
  100.   set !menu_selection %3
  101.   set !x_offset 12
  102.   set !y_offset 12
  103.   set !select_height 18
  104.   set !y_gump_excess 24
  105.  
  106.   exevent popup !findid
  107.   gosub GumpWait NULL normal_gump normal_gump
  108.   set #CONTPOSX 25
  109.   set #CONTPOSY 25
  110.   wait 10
  111.   str pos #CONTSIZE _
  112.   str del #CONTSIZE 1 #STRRES
  113.  
  114.   set !gump_y #STRRES
  115.   set !number_of_selections ( ( !gump_y - !y_gump_excess ) / !select_height )
  116.   for !line_number 1 !number_of_selections
  117.   {
  118.     set !clickxposition1 #CONTPOSX + !x_offset
  119.     set !clickyposition1 #CONTPOSY + !y_offset + ( !select_height * ( !line_number - 1 ) )
  120.     set !clickxposition2 !clickxposition1 + 150
  121.     set !clickyposition2 !clickyposition1 + !select_height - 1
  122.     gosub NewSampleArea NULL !clickxposition1 !clickyposition1 !clickxposition2 !clickyposition2
  123.     set !test . !line_number #RESULT  ; stores values in !test1, !test2, .. !test . n.  Put in debug mode to gather these sampled values
  124. ;    pause  ; include this pause to view sampled values.
  125.     if #RESULT = !menu_selection
  126.     {
  127.       click !clickxposition1 !clickyposition1 mc
  128.       namespace pop
  129.       return #FALSE ; no error, selection found
  130.     }
  131.   }
  132. ;  pause
  133.   namespace clear
  134.   namespace pop
  135. return #TRUE
  136. ;-------------------------------------------------------------------------------
  137. ; %1 = NewSampleArea
  138. ; %2 = x1coord
  139. ; %3 = y1coord
  140. ; %4 = x2coord
  141. ; %5 = y2coord
  142. ; %6 = return stamp
  143. sub NewSampleArea
  144.   namespace push
  145.   namespace local NSA2
  146.   set !temp_LPC #LPC
  147.   set #LPC 10000
  148.   set !stamp 0
  149.   set !x %2
  150.   set !blank_cnt 0
  151.   while !x <= %4
  152.   {
  153.     set !y %3
  154.     while !y <= %5
  155.     {
  156.       savepix !x !y 1
  157.       if #PIXCOL = 16777215
  158.       {
  159.         set !stamp ( !stamp + ( !x - %2 + 1 ) * 2048 + ( !y - %3 + 1 ) * 128 )
  160.         set !blank_cnt 0
  161.       }
  162.       else
  163.       {
  164.         set !stamp ( !stamp + ( !x - %2 ) * ( !y - %3 ) )
  165.       }
  166.       set !y !y + 2
  167.     }
  168.     set !blank_cnt !blank_cnt + 1
  169.     if !blank_cnt >= 10
  170.       goto NewSampleArea_skip1
  171.     set !x !x + 5 ; changing this will impact present sampled values!!
  172.   }
  173. NewSampleArea_skip1:
  174.   set #LPC !temp_LPC
  175.   set #RESULT !stamp
  176.   namespace pop
  177. return #RESULT
  178. ;-------------------------------------------------------------------------------
  179. ; %1 = GumpWait
  180. ; %2 = Gumpname 1
  181. ; %3 = Gumpname 2
  182. sub GumpWait
  183.   wait 10
  184.   set %timedelay #SCNT
  185.   GumpWait_loop1:
  186.     if #CONTNAME = %2 || #CONTNAME = %3
  187.       return
  188.     if #SCNT > %timedelay + 7
  189.       return
  190.     goto GumpWait_loop1
  191. return

This should work on both OSI and RunUO

9229
Bug discussion / Re: Unhandled Exception
« on: June 11, 2008, 09:55:54 PM »
Hey no problem at all, I figured my career-related expertise could come in handy for something really important :p

TBH, I'm psyched to be part of this project so I'm happy to break it and tell you how I did it whenever I can, hehe.

Well I'm happy to have ya'll playing with it.  It's been fun for me to write and a very therapeutic diversion from all the daily crap.  heh

9230
Bug discussion / Re: Unhandled Exception
« on: June 11, 2008, 03:32:47 PM »
By the way XII, that's the perfect information for me to debug the problem quickly.  Thank you for capturing it!

9231
Bug discussion / Re: Unhandled Exception
« on: June 11, 2008, 03:25:55 PM »
Sorry about that.  I know what that error is; that's the coloration error that can cause the editor to crash.  I do have that fixed in my version, but since nobody has run into it until now, I didn't publish a new version.  Now I will!  Hope you didn't loose much.

OH, that's a different one.  That's an easy one to fix.  Darn that range checking, you do 99% of them, but there's always one sneaky one to get through.  It's still a problem with the editor control, so I have to do the range checking before I hand over a number to the editor functions.

9232
I'm not sure I can walk the entire UO map the same way twice, lol.

Lol, well if you record the rail correctly the first time, then you'll only ever have to walk it once.  ;)

9233
Off Topic / Re: oh yeahhhhh
« on: June 11, 2008, 02:48:51 PM »
i would be happy to have that many..i would be happy to have 1.lol

I have never even owned one; how's that for lame??  lol

9234
New member introductions / Re: 'ello!
« on: June 11, 2008, 02:46:41 PM »
Hey, glad you found this place!  Welcome!

Hopefully when I bring out my new development tool, it'll make your learning experience better.

9235
That's definitely being shard specific.  You might think about doing some generic rails for people to get to locations, but then allow for users to add custom rails to get at specific areas.  With my rail engine, you can pass from one rail to another and have any number of rails in memory.  Also, you can stop and restart a rail or transfer from one rail to another.

One thing that you have to keep in mind when you are initially recording the rails is that you must walk the initial rail, otherwise you might not sample the location correctly and things might not be very happy.  This sucks for the initial rail development, but makes for flawless rail execution after the fact.

You might look at my idoc scanner and perhaps snip out what you need; really the idoc hunting portion is the easy code since you are looking for a known list of sign types and specific IDOC text.

I'll be sure to post the PDF guide to my rail engine later tonight.  I have a baseball game to goto this evening, so I'll be away for a bit.

9236
Off Topic / Re: oh yeahhhhh
« on: June 11, 2008, 01:32:15 PM »
I proclaim myself King Of Ultima Online. Simply because I had 124 val hammers in a bag and burned every single one of them.

Good grief, you get the king crown for sure!

9237
Actually, there was a script like that on uocoders if I remember correctly.  I'll have to think about it for a bit, but I believe there was one in the VIP section that used my rail engine/recoder to create the rails, then used my scanner to log places as it found them.

So I know it's very feasible and my rail writer makes it pretty simple to do.  Really, if you don't have to worry about the railing, and idoc hunting too much, then you should be able to manage the code pretty simply..  But yes, I like that idea.

9238
Off Topic / Re: oh yeahhhhh
« on: June 11, 2008, 11:58:25 AM »
Big Cheeze, Top Dog, The Whole Enchilada, MondoMan, ???

9239
New member introductions / Re: WOOT
« on: June 11, 2008, 10:43:36 AM »
hola all

glad to see so many faces i know and love.

well  im SOMJosh

i like bugs,  testing stuff,  and being a pain

lub u TM

Heh, thanks man.  Glad you have all my favorite people around again.  Check your status by the way.  It's nothing special, but it's all I can do at the moment.

9240
Gold Farming / Re: TrailMyx's Full Auto Fisherman
« on: June 10, 2008, 08:26:30 PM »
I'm glad it still works! lol.  Glad you enjoyed it.  Bookwyrm did get his monies worth out of it. He had 5 accounts running 24-7 with it.

Pages: 1 ... 614 615 [616] 617 618 ... 621