Recent Posts

Pages: [1] 2 3 ... 10
Scripting Chat / Re: Multiple For loops
« Last post by Hitechs on Today at 05:02:09 PM »
ah, nice nice , and an excellent explanation

thank you
Scripting Chat / Re: Multiple For loops
« Last post by Gaderian on Today at 04:42:53 PM »
To have 2 nested finditem based loops you have to keep track of your own version of #findindex and #findcnt.
There can be in issue if during the loop an item in the container (the ground can be a 'container' - so maybe it is better to think of it as "search confinement") disappears (is moved out of the 'container').

So it is definitely possible. I only do this when needed, not because it is so much slower (modern CPU and Easyuo 1.5 void the old thinking that 'finditem' is slow).
If you doubt the correctness of my comment on finditem isn't as slow as it is advertised, try it out for yourself. I did a test at a populated bank where I searched among 100 items in game in .005 seconds (5 ms).

Code: easyuo
  1. finditem %items g_ , %distance
  2. if #findcnt > 0
  3.    {
  4.    set %ItemsCount #findcnt ; keep the value for the %items #findcnt value
  5.    for %ItemsIndex 1 %ItemsCount
  6.       {
  7.       finditem %items %ItemsIndex g_ , %distance ; This has 4 parameters!
  8.       if #findcnt = 0
  9.          break ; this means an item was moved while we are processing the whole routine after the outer finditem above!
  10.       if #findtype = %doDad
  11.          {
  12.          finditem %stuff c_ , #backpackid
  13.          if #findcnt > 0
  14.             {
  15.             for #findindex 1 #findcnt
  16.                {
  17.                exevent drag #findid
  18.                exevent dropc %secureBox
  19.                wait 15
  20.                }
  21.             }
  22.          }
  23.       if #findtype = %thingaMajig
  24.          {
  25.          exevent drag #findid
  26.          exevent dropc #backpackid
  27.          wait 15
  28.          }
  29.       }
  30.    }

What has been added above:
1) check #findcnt > 0 after the finditem before doing the for loop, because if #findcnt is 0, then you do a loop when you have no data from values 1 counting down to 0.
2) keep track of the outer loop #FINDCNT
3) use your own variable - like how we would use #findindex...
4) reissue a finditem in the loop where we give 4 parameters which includes the index of the loop we want.

If you have moved out of the area an item in the ground search (or someone else has) then the logic breaks down. I wouldn't do this kind of logic for general population items in my script. Snicker7 did this in the original BodFiller script and that and a conversation with another scripter is how I learned about it. It is the way to keep track of more than 1 finditem in a loop.

There is a way where you could save all the data from the outer finditem loop and then try to process it all again in a second pass. That would allow you to skip over items that have been moved on you. This is only a valid issue if you have a list of 20 things you initially found and an earlier one in the list is moved (not by you) so that the list index changes. The above logic takes care of any future found items in the loop iteration being moved, because it bails if it gets to the end of the list too early.

Scripting Chat / Multiple For loops
« Last post by Hitechs on Today at 04:07:54 PM »

Was just wondering how you pros deal with for loop inside a for loop that runs off #findindex.
I have been just changing my logic so its not needed, and was wondering if that is my only options
so finditem creates findindex for first loop
but then inside that you need a 2nd findindex for 2nd for loop

Not possible? bad code? dont do that?


Code: [Select]
finditem %items g_ , %distance
for #findindex 1 #findcnt
      if #findtype = %doDad
            finditem %stuff c_ , #backpackid
            for #findindex 1 #findcnt
                       exevent drag #findid
                       exevent dropc %secureBox
                       wait 15
      if #findtype = %thingaMajig
            exevent drag #findid
            exevent dropc #backpackid
            wait 15
General UO Chat / Re: it is a prediction or warning of sorts...
« Last post by Gaderian on November 26, 2021, 08:41:23 PM »
There is a long thread about that over on Easyuo that goes on and on about how to decode that 'language'. Something Warlocke created, IIRC. I remember going through all of it and being able to basically read it on the fly, but I can't remember the rules now.
General UO Chat / Re: it is a prediction or warning of sorts...
« Last post by Hitechs on November 26, 2021, 07:02:38 PM »
Ykhixhx ykhyx, 'ixxhyx-ix viix viix-ix khalyxixm yxachxx yxhxhtchatythayxm 'o yth-ix yxxn'kaixhx yxxh yxtchth, viix viix-ix tchixyth 'o ythviixtchlyxix kthxxyxkth-ixythhx. Yth-ix 'yxthaixhx yxxh yth-ixhxix kthxxyxkth-ixythhx yxxix ixmythyxn'k'ixth yth-xxyxachkh-yxachyth yth-ix tchymth yth-ix tchalyxamkh myxvi tytchtch Atchhxhhixmyxx. Ixythh yxxh ythhhixn'k viyhx 'achxxaixth viayth` yxmix yxxh yth-ix thixn'kyxm athyxtchhx, ixythh yxxh yth-ixn'k viayth` yth-ixaxx yxvim hxhhyt'ktchixth khachyxxthaym hxkthaxxayth ythyx kthxxyxythixtyth ythhhixn'k ymth ythhhixaxx ythxxixyhxachxxix. Ythhhixo n'kachhxyth xxixn'kyam 'achxxaixth xhyxxx ytchtch ythan'kix, yhx ayth ahx ythhhix hxixkthyxxyythayxm yxxh yth-ixhxix kthyxviixx-hachtch hxon'k'yxtchhx yth-yyth 'kixixkthhx yth-ix thhyyxhx yth-yyth yth-ixo tym tyachhxix am thhixt'k. N'ko hxachkthix-ayx-hx 'ixtchaixlyxix yth-yyth yth-ixhxix hxythyythachixhx tym xxixhxachxx-ixtyth yth-ix thyxx'k khyxth yth-yyth viyhx yxmtix viyx-hxhhakthkthixth 'o yxachxx kthixyxkthtchix. A, hhyxviixlyxix`, 'kmyxvi yth-ix ythxxachyth`; Ythhhahx khyxth tym 'xxamkh yxmtcho thixyyth`, ixlyxixm ythyx yth-ix achmtchalyxamkh hxachthh yhx yxachxxhxixtchlyxixhx. A hxythxxyxmkhtcho ythlyxahxixth ykhyamhxyth yth-ix xxixhxachxx-ixtythayxm yxxh yth-yyth ythix`-a'tchix txxixyythachxxix, 'achyth yth-ix mixvi kthxxyxkth-ixythhx hxixixn'k hhixtchtch'ixmyth yxm yth-ixaxx xhyayth` ythyx akhmyx-ix n'ko viyxxmamkhhx. A vixxaythix yth-ahx 'yxyx'k hxyx yth-yyth hxyxn'kix thyo ayth n'kyo xxixythh ixyxxhx yth-yyth yxxix myxyth thixyxhixmixth 'o khxxixixth yx` xhyayth`.

-Ythlyxahxyx` 'Komythixyth`

someone also said something about witchs and burning.

Guess i need to study ...............
General UO Chat / it is a prediction or warning of sorts...
« Last post by Hitechs on November 26, 2021, 07:00:32 PM »
Tchachmy viatchch xhytchtch viayth' yth-ix mixvi oixyxx!

Edit * i did not create this, credit goes to warlocke

General UO Chat / old avatar pic
« Last post by Hitechs on November 26, 2021, 06:03:56 PM »
lol , found this old avatar pic, Man i looked young and hansom back then :/

What did your old forum picture look like?

New member introductions / Re: Hello
« Last post by gimlet on November 26, 2021, 01:02:13 PM »

New member introductions / Re: Hello
« Last post by Crisis on November 26, 2021, 10:16:41 AM »
Welcome to SUO! Thanks for your introduction - restricted status lifted - feel free to enjoy all the benefits of the site!
New member introductions / Hello
« Last post by grimnawg on November 26, 2021, 09:39:14 AM »
My gamer name is Grimnawg/Tek dependant on the type of game i am playing. Played Uo for many years starting out on the official servers where i mainly played on Siege Perilous ( think that how it spelled). My cousin and I ran a duo comp he was stealth/necro/assassin and i was stealth/thief/poison/assassin. Played more of an espionage type char there. Where i would join different guilds in disguise kits and essentially create wars between guilds that would lead to end goal.
     Currently I play on a few free servers trying to get back into the crafting side of UO. And as many know, when it comes to crafting, scripts are our best friends when it comes to gathering resources. As well as tons of spreadsheets. I have recently gotten in to scripting as far as creating sripts but still have much to learn and always looking for mentors.
Pages: [1] 2 3 ... 10