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

Pages: 1 2 3 [4] 5 6 ... 20
46
Script Debug / Re: Trick or treat starter
« on: October 22, 2020, 04:46:29 PM »
The smaller one. I THOUGHT I had deleted the other. My bad! Fixed now.

47
Script Debug / Re: Trick or treat starter
« on: October 22, 2020, 03:05:54 PM »
Never had the freeze with npc distance. I'll see if I can duplicate so I can fix it.

Waiting for someone WAY smarter than me (which is almost anyone) for advice on the blocked rune. It seems to be getting stuck in the TM random journal sub. I think I may have squashed this by downloading and pasting in a fresh copy of the TM travel sub.

Found and fixed an issue with it begging from the runebook.

Added South facing web type.

I have been running it all day, and frozen once at a moongate after a lag spike. I'm wondering if it is a latency issue. Otherwise, it seems to handle to teleport really well.

TAt the top of the script change %savecandy to #false. Change %trashcandy to #true. That should fix that portion.
Attached an updated betaV2 for you. That will fix some of it I hope.

48
Script Debug / Re: Trick or treat starter
« on: October 22, 2020, 06:40:29 AM »
Oracle, thanks for the test. I broke it last night trying to get fancy and was too tired. I got an extra hour so I fixed and partly tested. I did not test the trash sub, but the bank subs work fine. I updated the script to recalling straight through all locations for the beta file below. I did find a couple of specials ID's I had to add. If you find any, let me know and I'll get the types added. Thanks for testing!! If You find any I missed, post em here and I'll get them added.

still finding stuff I don't have in the specials yet. I know I'm missing the north/south webs. The Type is in the %loot list, but since I don't know what it is, I haven't moved it yet. THis could create a problem if you are dumping the candy, as they are getting dumped too.

Another minor issue is blocked runes. When I change the end location variable to +1, it tries to recall the the blocked rune, then stops. When I have it = the start location, it recalls over and over, then stops. Welcome any advice on this! (hint hint nudge nudge Gaderian)


49
Script Debug / Re: Trick or treat starter
« on: October 21, 2020, 08:51:49 PM »
ok. I want to advance the rune book by one rune when I run out of targets. As you say (i think) control the variable.
Code: [Select]
finditem HS_IS G_4 ;find trick or treat targets
    if #findcnt = 0 ; Teleported or all targeted, go to next rune in book.
    {
        ignoreitem reset ; clear queue
set %RuneLocStart %RuneLocStart + 1 ; start at first rune? I think this is how?
if %RuneLocStart > 16
 set %RuneLocStart 1
set %RuneLocEnd %RuneLocStart + 1 ;since runelocend is always one greater, should it reset to 1 first?
if %RuneLocEnd > 16
set%RuneLocEnd 1

gosub TM_TravelFromNamedRunebook RE %RuneLocStart %RuneLocEnd %BookName
    }

50
Script Debug / Re: Trick or treat starter
« on: October 21, 2020, 08:21:59 PM »
GOTCHA!!!
I only used the random because that was the only one i could get working. Which was the issue. I couldn't get any of the others to change runes, that is what I was really after.

Lets say I want to do sequential recall then, which is what I tried to do, but couldn't figure out how from the header.
I would much rather randomize my runes in the book at this point and recall sequentially 1- 16. Maybe when I get rid of my scripter pacifier I'll try the random multi book thingy.

While I figure THAT part out, which won't take a lot of code rearranging i think, I have gone ahead and fleshed out the bank and trash routines, with the option (hardcode for now) to save candy or trash it.
This is totally untested. I will not have the time until late tomorrow. If someone brave wants to take a stab, here it is.
Need one rune book with 16 trick or treat target runes named TrickOrTreat1.
One rune book with 16 bank runes named Bank
One rune book with 6 runes to trash barrels named Trash
2 empty bags in your bank (1 if you want to trash the candy)
It'll take about 12 hours to fill a 125 spots, or about 10 specials an hour. ish. I don't have a bank is full option coded, so it's up to you to watch that.

51
Script Debug / Re: Trick or treat starter
« on: October 21, 2020, 04:25:28 PM »
Im trying to figure out how to modify what Gaderian gave me to be less than 16. I think I got it, but will need to test it.

I tested all day, and even only doing half the runes was filling my pack about once pet hour. So figure 6 trash barrels to get a good spread over time.

52
Script Debug / Re: Trick or treat starter
« on: October 21, 2020, 07:19:12 AM »
First, Great news. Neo granted me permission to scavenge subs from his trick or treater, so it will be much easier to do the bank and trash subs!! Thanks NEO!!!!

I finally understood what you were getting at there Gaderian. I was misreading the instructions in the travel sub header, which lead to my confusion. I ASSUMED that the numbers represented the range of the runes in the book, not the range of runes to be used for the recall attempt.
When I ran the script with your suggested changes, I noticed it was skipping every other rune n the book, because of :
Code: [Select]
set %RuneLocStart %RuneLocStart + 2Yet, it worked flawlessly except for not hitting all the runes.
When I changed it to :
Code: [Select]
set %RuneLocStart %RuneLocStart + 1I would always get stuck on the third rune and not change to the fourth.

Here is a decently working version, but you have to dump it every couple of hours.

Need 16 runes to places with 2 or more valid trick or treat targets that are static. Targets must be within 4 tiles for Trick Or Treat to work.


Ill work on adding in NEO's subs later today. One tip, Do not start it standing on your first recall spot. It will get stuck. Start from your home or anywhere and it will be fine.

*heads up for prep* Ill probably call for a 16 bank rune book and a 16 trash rune book as well. Lots of set up I know, but beats getting paged. I just gotta fix the skipping thing.

53
Script Debug / Re: Trick or treat starter
« on: October 20, 2020, 10:16:45 PM »
I had to take some time off due to RL world stuffs. Im back and working at it. Thank you very much Gaderian and Ghost for your time and suggestions! Ill have a test done tomorrow I think Oracle

54
Script Debug / Re: Trick or treat starter
« on: October 05, 2020, 10:52:21 PM »
OKay, I took all the suggestions and rethought my process using ghosts simplification. I instead went with TM's recall sub. The script seems to work, but the runebook wont change pages, instead it stays on the starting number in the range, no matter what I put it at. I will be adding other subs, weight check, bank, trash, menu, etc once I get this working and recalling around. I tried recall from targeted runebook, and recall from named runebook. same result. Random runebook travel works though. However, it doesn't appear to detect blocked spots. If it randomly chooses the same spot I occupy, it recalls continously.


Code: easyuo
  1. mainloop:
  2. gosub find
  3. gosub trickortreat
  4. goto mainloop
  5.  
  6. sub find
  7.   repeat
  8.     wait 1
  9.     finditem HS_IS G_4
  10.     if #findcnt = 0
  11.     {
  12.         ignoreitem reset
  13.        gosub TM_TravelFromNamedRunebook RE 1 5 TRICKORTREAT1
  14.     }
  15.     if #findid = #charid
  16.         ignoreitem #FINDID
  17.     if #findrep = 2_3_4_5_6
  18.        ignoreitem #FINDID
  19.   until #FINDcnt >= 1 && #findid <> #charid
  20. RETURN
  21.  
  22. Sub trickortreat
  23. msg $trick or treat
  24. set #ltargetid #findid
  25. set #ltargetkind 1
  26. repeat
  27.  wait 1
  28. until #targcurs <> 0
  29. target
  30. Event macro 22 0
  31. ignoreitem #ltargetid
  32. return
  33.  
  34. ;=================================================================
  35. ; Script Name: TrailMyx's Runebook/Spellcast Subs
  36. ; Author: TrailMyx
  37. ; Version: 2.5
  38. ; Shard OSI / FS: OSI / FS
  39. ; Revision Date: 09/27/2007
  40. ; Purpose:
  41. ;   Runebook subs to manage your runebook travel needs.  You need either to know
  42. ;   the runebook ID or runebook name.
  43. ;
  44. ; Subroutines:
  45. ;     TM_NewCastSpell - casts spells with appropriate waits, delays, retrys.
  46. ;     TM_TravelFromRunebook - Uses specified runbook #FINDID to travel from .  If a location is blocked
  47. ;                             the next location will be tried until success.
  48. ;     TM_TravelFromNamedRunebook - Same as TM_TravelFromRunebook, but allows you to specify a runebook name
  49. ;
  50. ;  Examples:
  51. ;     gosub TM_NewCastSpell 31 !rbook 10 20 20 ; recall
  52. ;     gosub TM_TravelFromRunebook RE 1 3 %runebookid ; travel (recall) to location from #FINDID runebook using slots 1-3
  53. ;     gosub TM_TravelFromNamedRunebook GA 1 2 LUMBERJACKING1 ; gate using LUMBERJACKING1 runebook starting at rune 1
  54. ;     gosub TM_RandomRunebookTravel SJ 1 6 %runebookid  ; Randomly choose a rune from 1-6 in runebook
  55. ;     gosub TM_TravelFromObject RE %runeid ; travels to rune specified by %runeid
  56. ;
  57. ;  Use of these subrountes is allowed, but please give me (TrailMyx) credit somewhere in your script.
  58. ;
  59. ;  Release History:
  60. ;     2.0 - Initial public release
  61. ;     2.1 - Bug in TM_FindValidTextNoAdvance, added return value to TM_TravelFromNamedRunebook
  62. ;     2.2 - Bug in TM_NewCastSpell when mana gets too low
  63. ;     2.3 - Better spellcasting for chivalry, necro
  64. ;           Added TM_TravelFromNamedRunebook
  65. ;           Added TM_RandomRunebookTravel
  66. ;     2.4 - Little fix for journal handler
  67. ;     2.5 - Hack to allow for transport through a red moongate.
  68. ;
  69. ;  Requirements:
  70. ;
  71. ;    This script requires that you have your character name
  72. ;    setup in a variable called %charname.  Place this bit of code
  73. ;    in your script initialization somewhere:
  74. ;
  75. ;   gosub TM_AddUnderscore #CHARNAME
  76. ;   set %charname #RESULT
  77. ;=================================================================
  78. ;-------------------------------------------------------------------------------
  79. ; %1 = spell number
  80. ; %2 = #TARGETID or SELF or NONE
  81. ; %3 = retry count (-1 = cast until successful)
  82. ; %4 = cast delay
  83. ; %5 = recovery delay
  84. sub TM_NewCastSpell
  85.   namespace push
  86.   namespace local NCS
  87.   set !lpc #LPC
  88.   set #LPC 100
  89.   set !whichspell %1
  90.   set !whichtarget %2
  91.   set !castretrymax %3
  92.   set !waitdelay %4
  93.   set !recovery_delay %5
  94.  
  95.   set !castretry 0
  96.   set !temp_ltargetid #LTARGETID
  97.   set !temp_ltargetkind #LTARGETKIND
  98.  
  99.   NewCastSpell_loop1:
  100.     if !castretrymax < 0
  101.       goto NewCastSpell_cont1
  102.     if !castretry > !castretrymax
  103.       goto NewCastSpell_end1
  104.     NewCastSpell_cont1:
  105.       gosub TM_AdvJournalSync SPELLCAST
  106.       set #LTARGETKIND 1
  107.       set #LTARGETID !whichtarget
  108.       set !tempmana #MANA
  109.       event macro 15 !whichspell ; cast the spell
  110.       wait !waitdelay
  111.       set !targettimeout #SCNT + 7
  112.       NewCastSpell_wait1:
  113.         gosub TM_AdvJournalScan SPELLCAST VALID you_have_not_yet mana your_spirit more_reagents
  114.         if #RESULT = #TRUE || #SCNT > !targettimeout
  115.         {
  116.           set !casttimeout #SCNT2 + !recovery_delay
  117.           repeat
  118.           until #SCNT2 > !casttimeout     ; finish up cast delay
  119.           set !castretry !castretry + 1
  120.           goto NewCastSpell_loop1
  121.         }
  122.         if !whichtarget = NONE
  123.           goto NewCastSpell_skip1
  124.         if #TARGCURS = 1
  125.           goto NewCastSpell_targ1
  126.         goto NewCastSpell_wait1 ; wait for target cursor
  127.  
  128.   NewCastSpell_targ1:
  129.     if !whichtarget = SELF
  130.       event macro 23
  131.     else
  132.       event macro 22
  133.  
  134.   NewCastSpell_skip1:
  135.     wait 5
  136.     set !casttimeout #SCNT2 + !recovery_delay
  137.     NewCastSpell_skip2:
  138.       if !whichspell >= 0 && !whichspell <= 63 ; Magery
  139.       {
  140.         gosub TM_AdvJournalScan SPELLCAST VALID spell_fizzles there_is_already mana your_spirit more_reagents
  141.       }
  142.       else
  143.       {
  144.         set !cont #FALSE  ; Chivalry, Necromancy, etc
  145.         finditem !whichtarget *
  146.         if !whichtarget in SELF_NONE || #FINDKIND <> -1
  147.           set !cont #TRUE
  148.  
  149.         if #MANA >= !tempmana && !cont = #TRUE ; check if target is still there
  150.           set #RESULT #TRUE
  151.         else
  152.           set #RESULT #FALSE
  153.       }
  154.       repeat
  155.       until #SCNT2 > !casttimeout     ; finish up cast delay
  156.       if #RESULT = #TRUE
  157.       {
  158.         if !castretrymax > -1
  159.         {
  160.           set !castretry !castretry + 1 ; %castretrymax of -1 will cast until successful
  161.           if !castretry > !castretrymax
  162.             goto NewCastSpell_end1
  163.         }
  164.         goto NewCastSpell_loop1
  165.       }
  166.       if #SCNT2 <= !casttimeout     ; finish up cast delay
  167.         goto NewCastSpell_skip2
  168.   NewCastSpell_end1:
  169.     set #LTARGETID !temp_ltargetid
  170.     set #LTARGETKIND !temp_ltargetkind
  171.     set #LPC !lpc
  172.     namespace pop
  173. return
  174. ;-------------------------------------------------------------------------------
  175. ; %1 = Method (RE, GA, SJ)
  176. ; %2 = index location within runebook (1-16)
  177. ; %3 = index location within runebook (1-16), try up to this point
  178. ; %4 = runebook item id
  179. ; returns #TRUE if error, #FALSE for no error
  180. sub TM_TravelFromRunebook
  181.   namespace push
  182.   namespace local RFR
  183.   set #LTARGETKIND 1
  184.   set !method %1
  185.   set !locindex %2
  186.   set !locindexend %3
  187.   set !rbook %4
  188.  
  189.   finditem !rbook C_ , #BACKPACKID
  190.   if !method notin RE_GA_SJ || #FINDKIND = -1
  191.   {
  192.     namespace pop
  193.     return #TRUE
  194.   }
  195.   if !locindex notin 1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16
  196.   {
  197.     namespace pop
  198.     return #TRUE
  199.   }
  200.   if !locindexend notin 1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16
  201.   {
  202.     namespace pop
  203.     return #TRUE
  204.   }
  205.  
  206.   TravelFromRunebook_loop1:
  207.     set #LOBJECTID !rbook
  208.     set #LTARGETKIND 1
  209.     event macro 17 0
  210.     gosub GumpWait generic_gump generic_gump
  211.  
  212.     set !runeclickx 140 ; page 1, rune 1
  213.     set !runeclickx ( #CONTPOSX + !runeclickx + ( 35 * ( ( !locindex - 1 ) / 2 ) ) )
  214.     if !locindex > 8
  215.     {
  216.       set !runeclickx 310 ; page 2, rune 1
  217.       set !runeclickx ( #CONTPOSX + !runeclickx + ( 35 * ( ( !locindex - 9 ) / 2 ) ) )
  218.     }
  219.     set !runeclicky #CONTPOSY + 196
  220.     click !runeclickx !runeclicky
  221.     wait 5
  222.  
  223.     set !runeclicky #CONTPOSY + 24
  224.     set !runeclickx #CONTPOSX + 164 ; page 1 set to default
  225.     if !locindex % 2 = 0
  226.     {
  227.       set !runeclickx #CONTPOSX + 305 ; page 2 set to default
  228.     }
  229.     click !runeclickx !runeclicky
  230.     wait 5
  231.     set !oldx #CHARPOSX
  232.     set !oldy #CHARPOSY
  233.     if !method = RE
  234.       gosub TM_NewCastSpell 31 !rbook -1 10 10 ; recall until successful
  235.     if !method = GA
  236.     {
  237.       gosub TM_NewCastSpell 51 !rbook -1 10 20 ; gate until successful
  238.       set !temp_cnt #SCNT + 10
  239.       repeat
  240.         finditem KEF_OTF_JEF G_0
  241.       until #FINDKIND <> -1 || #SCNT > !temp_cnt
  242.       if #FINDKIND <> -1
  243.       {
  244.         set #LOBJECTID #FINDID
  245.         wait 10
  246.         event macro 17 0
  247.         wait 20
  248.         if #CONTNAME = generic_gump && #CONTSIZE = 420_280
  249.         {
  250.           gosub TM_AdvJournalSync SPELLCAST
  251.           set !clickx #CONTPOSX + 26
  252.           set !clicky #CONTPOSY + 261
  253.           click !clickx !clicky ; click ok
  254.         }
  255.       }
  256.     }
  257.  
  258.     if !method = SJ
  259.       gosub TM_NewCastSpell 210 !rbook -1 10 30 ; sacred journey until successful
  260.     wait 30
  261.  
  262.     set !tempscnt #SCNT + 10
  263.   WaitforTravel_loop1:
  264.     gosub TM_AdvJournalScan SPELLCAST VALID location_is_blocked something_is_blocking you_spirit_lacks
  265.     if #RESULT = #TRUE
  266.     {
  267.       gosub TM_AdvJournalSync SPELLCAST
  268.       set !locindex !locindex + 1
  269.       if !locindex > !locindexend
  270.       {
  271.         namespace pop
  272.         return #TRUE
  273.       }
  274.       goto TravelFromRunebook_loop1
  275.     }
  276.     if ( ( #CHARPOSX = !oldx && #CHARPOSY = !oldy ) && #SCNT < !tempscnt )
  277.       goto WaitforTravel_loop1
  278.  
  279.   if #CONTNAME = generic_gump && #CONTSIZE = 452_236 ; RunUO close runebook
  280.   {
  281.     set !clickx #CONTPOSX + 120
  282.     set !clicky #CONTPOSY + 60
  283.     click !clickx !clicky mc r
  284.     wait 5
  285.   }
  286.   namespace pop
  287.   click 401 254 n
  288. return #FALSE
  289. ;------------------------------------------------
  290. ; %1 method
  291. ; %2 starting index
  292. ; %3 ending index
  293. ; %4 runebook name
  294. sub TM_TravelFromNamedRunebook
  295.   namespace push
  296.   namespace local TFNR
  297.   set !method %1
  298.   set !start_index %2
  299.   set !end_index %3
  300.   set !runbook_name %4
  301.   if !method notin RE_GA_SJ
  302.   {
  303.     namespace pop
  304.     return #TRUE
  305.   }
  306.   if !start_index notin 1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16
  307.   {
  308.     namespace pop
  309.     return #TRUE
  310.   }
  311.   if !end_index notin 1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16
  312.   {
  313.     namespace pop
  314.     return #TRUE
  315.   }
  316.   locatenamedrunebook:
  317.     finditem ZBN C_ , #BACKPACKID
  318.     if #FINDKIND <> -1
  319.     {
  320.       event property #FINDID
  321.       if !runbook_name in #PROPERTY
  322.       {
  323.         gosub TM_TravelFromRunebook !method !start_index !end_index #FINDID ; recall to location
  324.       }
  325.       else
  326.       {
  327.         ignoreitem #FINDID rbook
  328.         goto locatenamedrunebook
  329.       }
  330.     }
  331.     else
  332.     {
  333.       display ok Cannot locate specified runebook named , #SPC , !runbook_name
  334.       stop
  335.     }
  336.   ignoreitem reset rbook
  337.   namespace pop
  338. return
  339. ;-------------------------------------------------------------------------------
  340. sub TM_RandomRunebookTravel
  341.   namespace push
  342.   namespace local RRT
  343.   set !travelmethod %1
  344.   set !rune1 %2
  345.   set !rune2 %3
  346.   set !runebook %4
  347.   if !rune1 > !rune2
  348.   {
  349.     set !temp !rune2
  350.     set !rune2 !rune1
  351.     set !rune1 !temp
  352.   }
  353.   RunebookTravel_loop1:
  354.     set !random #RANDOM
  355.     set !rune ( ( !random % ( !rune2 - !rune1 + 1 ) ) + !rune1 )
  356.     gosub TM_TravelFromRunebook !travelmethod !rune !rune !runebook
  357.     if #RESULT = #TRUE
  358.       goto RunebookTravel_loop1
  359.   namespace pop
  360. return
  361. ;-------------------------------------------------------------------------------
  362. ; %1 = Method (RE, GA, SJ)
  363. ; %2 = Object Findid
  364. ; returns #TRUE if error, #FALSE for no error
  365. sub TM_TravelFromObject
  366.   namespace push
  367.   namespace local RFR
  368.   set !method %1
  369.   set !object %2
  370.  
  371.   finditem !object C_ , #BACKPACKID
  372.   if !method notin RE_GA_SJ || #FINDKIND = -1
  373.   {
  374.     namespace pop
  375.     return #TRUE
  376.   }
  377.  
  378.   set !oldx #CHARPOSX
  379.   set !oldy #CHARPOSY
  380.   TravelFromObject_loop1:
  381.     if !method = RE
  382.       gosub TM_NewCastSpell 31 !object -1 10 10 ; recall until successful
  383.     if !method = GA
  384.     {
  385.       gosub TM_NewCastSpell 51 !object -1 10 20 ; gate until successful
  386.       set !temp_cnt #SCNT + 10
  387.       repeat
  388.         finditem KEF_OTF_JEF G_0
  389.       until #FINDKIND <> -1 || #SCNT > !temp_cnt
  390.       if #FINDKIND <> -1
  391.       {
  392.         set #LOBJECTID #FINDID
  393.         wait 10
  394.         event macro 17 0
  395.         wait 20
  396.         if #CONTNAME = generic_gump && #CONTSIZE = 420_280
  397.         {
  398.           gosub TM_AdvJournalSync SPELLCAST
  399.           set !clickx #CONTPOSX + 26
  400.           set !clicky #CONTPOSY + 261
  401.           click !clickx !clicky ; click ok
  402.         }
  403.       }
  404.     }
  405.  
  406.     if !method = SJ
  407.       gosub TM_NewCastSpell 210 !object -1 10 30 ; sacred journey until successful
  408.     wait 30
  409.  
  410.     set !tempscnt #SCNT + 10
  411.   WaitforTravel2_loop1:
  412.     gosub TM_AdvJournalScan SPELLCAST VALID location_is_blocked something_is_blocking your_spirit_lacks
  413.     if #RESULT = #TRUE
  414.     {
  415.       gosub TM_AdvJournalSync SPELLCAST
  416.       set !locindex !locindex + 1
  417.       if !locindex > !locindexend
  418.       {
  419.         namespace pop
  420.         return #TRUE
  421.       }
  422.       goto TravelFromObject_loop1
  423.     }
  424.  
  425.     if ( ( #CHARPOSX = !oldx && #CHARPOSY = !oldy ) && #SCNT < !tempscnt )
  426.       goto WaitforTravel2_loop1
  427.   namespace pop
  428. return #FALSE
  429. ;-------------------------------------------------------------------------------
  430. ; %1 - Journal Name
  431. ; %2 - #LPC setting (optional)
  432. ; Brings !_jindex up to the most recent #journal entry
  433. sub TM_AdvJournalSync
  434.   namespace push
  435.   namespace local TM_AdvJS_ , %1
  436.   set !_jindex #jindex + 1
  437.   if %0 > 1
  438.     set !lpc_set %2
  439.   namespace pop
  440.   set !TM_FunctionCalled #TRUE
  441. return
  442. ;-------------------------------------------------------------------------------
  443. ; %1 - Journal Name
  444. ; %2 - NONE, ADVANCE , ( _VALID ) - advances jindex pointer, anything else
  445. ; %3, %4, %5, etc strings to match
  446. ; returns #TRUE for match, #FALSE for no match
  447. ;  Will not advance !_jindex pointer to allow for scanning journal history for more than one search.
  448. ;  Also searches for : , #SPC in journal entry to be sure someone isn't spamming the text
  449. ;  About %2 arguments:
  450. ;    NONE: defaults to basic journal scan (no SPAM checking, no #jindex pointer copy advancing)
  451. ;    ADVANCE: no spam checking, advances #jindex copy
  452. ;    VALID: invokes SPAM filtering, no advance of #jindex copy
  453. ;    VALID_ADVANCE, VALIDADVANCE, ADVANCE_VALID, etc.: invokes SPAM filtering, advances of #jindex copy
  454. sub TM_AdvJournalScan
  455.   namespace push
  456.   namespace local TM_AdvJS_ , %1
  457.   set !args %2
  458.   set !temp_lpc #LPC
  459.   if !lpc_set = N/A
  460.     set #LPC 1000
  461.   else
  462.     set #LPC !lpc_set
  463.   set !num_args %0
  464.   set !first_arg 3
  465.   if !_jindex = N/A
  466.     set !_jindex #jindex
  467.   if !charname = N/A
  468.   {
  469.     set !charname #CHARNAME
  470.     AdvJournalScan_loop1:
  471.       str pos !charname #SPC
  472.       if #STRRES <> 0
  473.       {
  474.         set !val #STRRES - 1
  475.         str left !charname !val
  476.         set !left #STRRES
  477.         set !val !val + 1
  478.         str del !charname 1 !val
  479.         set !charname !left , _ , #STRRES
  480.         goto AdvJournalScan_loop1
  481.       }
  482.   }
  483.   set !index !first_arg
  484.   repeat
  485.     set !temp_jindex !_jindex
  486.     set !text % . !index
  487.     while !temp_jindex <= #jindex
  488.     {
  489.       scanjournal !temp_jindex
  490.       str pos #JOURNAL !charname 1
  491.       set !namepos #STRRES
  492.       str count #JOURNAL !charname
  493.       set !namecnt #STRRES
  494.       str pos #JOURNAL :_ 1
  495.       set !smcpos #STRRES
  496.       str pos #JOURNAL !text 1
  497.       set !textpos #STRRES
  498.       if !textpos < !smcpos && !smcpos <> 0 || !smcpos = 1 || :_ notin #JOURNAL || VALID notin !args
  499.         set !pass #TRUE
  500.       else
  501.         set !pass #FALSE
  502.       if ( !text in #journal && ( ( !namepos = 1 && !namecnt <= 1 ) || !pass ) )
  503.       {
  504.         set !temp_jindex !temp_jindex + 1
  505.         if ADVANCE in !args
  506.           set !_jindex !temp_jindex
  507.         set #LPC !temp_lpc
  508.         namespace pop
  509.         set !TM_FunctionCalled #TRUE
  510.         return #TRUE
  511.       }
  512.       set !temp_jindex !temp_jindex + 1
  513.     }
  514.     set !index !index + 1
  515.   until !index - !first_arg > !num_args - !first_arg
  516.   set #LPC !temp_lpc
  517.   namespace pop
  518.   set !TM_FunctionCalled #TRUE
  519. return #FALSE
  520. ;-------------------------------------------------------------------------------
  521. ; %1 = Gumpname 1
  522. ; %2 = Gumpname 2
  523. ; #TRUE gump occured before timeout
  524. sub GumpWait
  525.   namespace push
  526.   namespace local GW
  527.   wait 10
  528.   set !timedelay #SCNT
  529.   while #SCNT <= !timedelay + 7
  530.   {
  531.     if #CONTNAME = %1 || #CONTNAME = %2
  532.     {
  533.       namespace pop
  534.       return #TRUE
  535.     }
  536.   }
  537.   namespace pop
  538. return #FALSE
  539.  

55
Script Debug / Re: Trick or treat starter
« on: October 05, 2020, 09:02:20 PM »
Good suggestions Ghost. Those steps are in my plan. But FIRST, I have to get it to recognize that I teleported away. Either way, getting the hang of the journal scan is actually my priority here.

56
Script Debug / Trick or treat starter
« on: October 05, 2020, 08:56:16 AM »
HI! I'm baby stepping my way through making a robust trick or treater. First, I want to ensure I can reliably target, trick or treat, detect a teleport, and recall back to the spot. The script will "eventually" be a recall based script with bank/trash support. BUT I am having issues getting it to detect the teleport. This is what I have for one static NPC. The targetting and trick or treat and timing are spot on so far.

Code: [Select]
Display ok Target your recall rune or book
set #targcurs 1
  while #targcurs = 1
    wait 0
  set %rune #ltargetid
wait 5
;----------
 Display ok Target your First Animal.
     set #targcurs 1
  while #targcurs = 1
    wait 0
  set %heal1 #ltargetid
wait 5
;-----------
mainloop:
gosub TM_AdvJournalSync TRICK 100
gosub trickortreat1
wait 60s
return
;----------
Sub trickortreat1
set #ltargetid %heal1
set #ltargetkind 1
msg $trick or treat
 if  #targcurs = 0
{
 repeat
}
target
Event macro 22 0
gosub trickcheck
return
;-----------
Sub trickcheck
gosub TM_AdvJournalScan TRICK VALID_Advance teleports
 If #result = #true
          {
          msg $trick detected
           }
  return
;=================================================================
; Script Name: TrailMyx's Advanced Journal Scanner
; Author: TrailMyx     gosub TM_AdvJournalScan heal VALID_ADVANCE
; Version: 1.2
; Shard OSI / FS: OSI / FS?
; Revision Date: 10/20/2007
; Purpose:
;   Use these subs to quickly find text in your #journal entries.  These subs
; use #jindex for flawless journal scanning and is much more reliable than using
; standard indexing of #journal and #SYSMSG.
;
;   Now it is possible to manage separate journals based on unrelated text.  It's now possible
; to monitor spellcasting, bandaging, stealing, or anything else without a TM_AdvJournalSync
; potentially removing text needed for another UO funciton.
;
;   New is the ability to either gosub or call these functions without the need to change the
; header!  When calling, a limit of 10 arguments is allowed, but more can be added by editing the
; call interface section.
;
;  Examples:
;     gosub TM_AdvJournalSync speech 100 ; sync "speech" journal space, set #LPC to 100 from default of 1000
;     gosub TM_AdvJournalScan speech VALID Find_this_text and_find_this_too ; will not advance copy of #jindex
;     gosub TM_AdvJournalScan heal VALID_ADVANCE you_heal_what that_patient_is_not ; advances pointer after scan
;     gosub TM_AdvJournalScan spellcast NONE fizzle ; no spam checking and doesn't advance #jindex copy automatically
;
;  Subs included:
;     TM_AdvJournalGetTrigger - retrieve the triggering string (#FALSE for no trigger)
;     TM_AdvJournalSync - Must call this in initialzation
;     TM_AdvJournalScan - see header for details....
;
;  Release history:
;    v1.0 - Initial release.
;    v1.1 - debug code added, fixed small possibility to miss an incoming journal entry
;
;  Requirements:
;    Nothing special
;
;  Credit:
;    If you use these subs, please leave credit for me somewhere in your script header.
;=================================================================
;------------------------  Call interface  -----------------------
;=================================================================
set !TM_FunctionCalled #FALSE
if %0 = 1
  gosub %1
if %0 = 2
  gosub %1 %2
if %0 = 3
  gosub %1 %2 %3
if %0 = 4
  gosub %1 %2 %3 %4
if %0 = 5
  gosub %1 %2 %3 %4 %5
if %0 = 6
  gosub %1 %2 %3 %4 %5 %6
if %0 = 7
  gosub %1 %2 %3 %4 %5 %6 %7
if %0 = 8
  gosub %1 %2 %3 %4 %5 %6 %7 %8
if %0 = 9
  gosub %1 %2 %3 %4 %5 %6 %7 %8 %9
if %0 = 10
  gosub %1 %2 %3 %4 %5 %6 %7 %8 %9 %10
if %0 = 11
  gosub %1 %2 %3 %4 %5 %6 %7 %8 %9 %10 %11
if %0 > 11
{
  display ok Too many arguments for "call", edit file.
  stop
}

if !TM_FunctionCalled = #TRUE
  exit
if %0 = N/A
  display ok You may not run this script directly.
else
  display ok Function " , %1 , " not found.
stop
;-------------------------------------------------------------------------------
sub TM_AdvJournalGetTrigger
  namespace push
  namespace local TM_AdvJS_ , %1
  set #RESULT !trigger
  namespace pop
  set !TM_FunctionCalled #TRUE
return #RESULT
;-------------------------------------------------------------------------------
; %1 - Journal Name
; %2 - #LPC setting (optional)
; Brings !_jindex up to the most recent #journal entry
sub TM_AdvJournalSync
  namespace push
  namespace local TM_AdvJS_ , %1
  set !_jindex #jindex + 1
  if %0 > 1
    set !lpc_set %2
  namespace pop
  set !TM_FunctionCalled #TRUE
return
;-------------------------------------------------------------------------------
; %1 - Journal Name
; %2 - NONE, ADVANCE , ( _VALID ) - advances jindex pointer, anything else
; %3, %4, %5, etc strings to match
; returns #TRUE for match, #FALSE for no match
;  Will not advance !_jindex pointer to allow for scanning journal history for more than one search.
;  Also searches for : , #SPC in journal entry to be sure someone isn't spamming the text
;  About %2 arguments:
;    NONE: defaults to basic journal scan (no SPAM checking, no #jindex pointer copy advancing)
;    ADVANCE: no spam checking, advances #jindex copy
;    VALID: invokes SPAM filtering, no advance of #jindex copy
;    VALID_ADVANCE, VALIDADVANCE, ADVANCE_VALID, etc.: invokes SPAM filtering, advances of #jindex copy
sub TM_AdvJournalScan
  namespace push
  namespace local TM_AdvJS_ , %1
  set !args %2
  set !temp_lpc #LPC
  if !lpc_set = N/A
    set #LPC 1000
  else
    set #LPC !lpc_set
  set !num_args %0
  set !first_arg 3
  set !sampled_jindex #JINDEX
  if !_jindex = N/A
    set !_jindex !sampled_jindex
  if !charname = N/A
  {
    set !charname #CHARNAME
AdvJournalScan_loop1:
    str pos !charname #SPC
    if #STRRES <> 0
    {
      set !val #STRRES - 1
      str left !charname !val
      set !left #STRRES
      set !val !val + 1
      str del !charname 1 !val
      set !charname !left , _ , #STRRES
      goto AdvJournalScan_loop1
    }
  }
  set !index !first_arg
  repeat
    set !temp_jindex !_jindex
    set !text % . !index
    while !temp_jindex <= !sampled_jindex
    {
      scanjournal !temp_jindex
      str pos #JOURNAL !charname 1
      set !namepos #STRRES
      str count #JOURNAL !charname
      set !namecnt #STRRES
      str pos #JOURNAL :_ 1
      set !smcpos #STRRES
      str pos #JOURNAL !text 1
      set !textpos #STRRES
      if !textpos < !smcpos && !smcpos <> 0 || !smcpos = 1 || :_ notin #JOURNAL || VALID notin !args
        set !pass #TRUE
      else
        set !pass #FALSE
      if ( !text in #journal && ( ( !namepos = 1 && !namecnt <= 1 ) || !pass ) )
      {
        set !temp_jindex !temp_jindex + 1
        if ADVANCE in !args
          set !_jindex !temp_jindex
        set !trigger !text
        set #LPC !temp_lpc
        namespace pop
        set !TM_FunctionCalled #TRUE
        return #TRUE
      }
      set !temp_jindex !temp_jindex + 1
    }
    set !index !index + 1
  until !index - !first_arg > !num_args - !first_arg
  set %10 !sampled_jindex - !_jindex
  set %10 %1 , _ , %10 ; for debugging purposes
  set #LPC !temp_lpc
  set TM_AdvJournalGetTrigger #FALSE
  namespace pop
  set !TM_FunctionCalled #TRUE
return #FALSE
;-------------------------------------------------------------------------------


57
General UO Chat / stealther removing my VE without flagging
« on: September 16, 2020, 06:33:39 AM »
I have a stealther on my shard that will come in when I am spawning and remove my VE somehow. We are both VVV. He does not flag as attacking. It does reveal him. How is he doing it? Any Ideas? And How can I defeat it?

58
Character skill advancement / Re: Meattwad's Simple Beggar
« on: July 28, 2020, 09:17:06 AM »
Thanks for the script. Works well. I added in ignore #findrep 2-7 because of all the invulnerable npc's now.
Code: [Select]
    if #findrep = 2_3_4_5_6_7
       ignoreitem #FINDID

59
Character skill advancement / Re: NSJT Nijutsu Shadow Jump Trainer
« on: June 11, 2020, 09:19:44 PM »
Tested today. Works Great! No problems once I figured out I could not be in a house. DUH. Smooth and easy. Thank you!

60
Scripting Chat / Re: Working Taming Script?
« on: May 05, 2020, 10:03:30 AM »
I just used madd dog's jhelom trainer, and I had no issues with the script. Another guy was there running the same script. If it's crashing, did you kill something in the pen before starting? One hot tip, trining from 50 to 70 is slowwwww. If you jewel up to tame bulls, then take them off, you gain much faster to 90.

Pages: 1 2 3 [4] 5 6 ... 20