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

Pages: 1 2 [3] 4 5
31
so, before anything dies and before you loot anything, try adding

Code: [Select]
set %checkweight #weight
then, wherever the stuff spawns in your bag, that's where the gosub auto_insure needs to be, and put this if around it:
Code: [Select]
if #weight > %checkweight
{
sub auto_iinsure
...
return
}

I also made a mistake in the inner most if statement, it should be:

Code: [Select]
            exevent popup #charid
            wait 10 <---- this should be here, to give the context menu time to pop
            click x y
            set #ltargetid #findid
            set #ltargetkind 1
            target
            event macro 22 0
            key esc

this may fix the issue, but I don't know...

PLEASE POST YOUR FIXES!!!! ANY AND ALL ITERAIONS!!! IT IS IMPOSSIBLE FOR ME TO KNOW WHAT ISN'T WORKING WIHOUT SEEING THE LOGIC!!!!

32
Scripting Chat / Re: #contblah issues
« on: February 03, 2016, 03:58:16 PM »
Quick note, you are closing your While loops before you ever run anything.

LOL hahaha
so I like to make my waits variable rather than static... In my experience (may be different on OSI) after clicking the shovel button, you have to wait for the gump to reappear to close it, this takes somewhere beteween 1400 and 1800ms sometimes more (I also have to deal with 4 second saves every now and then, where the screen freezes)

I could use a wait 20 which would cover the gump reappearing most of the time, but that doesn't cover the server saves, so I'd have to go with a wait 90 to compensate, but that would be real lame as it wastes a lot of time, so writing my waits like:

Code: [Select]
while something not true || something true
{
}

allows for variable wait times that always wait the minimal amount of time (including lag) before performing the next action. I sometimes write gotos with ifs if the procedure calls for it:

Code: [Select]
set %propcheck #property
finditem * c
propwait:
event property #findid
if #property = %propcheck
   goto propwait

that's not really the best example, but I did use something like that for about 2 weeks, before I found a better way.

Quote
Keep it simple, after you are done making a shovel just click Exit ("click #contposx+30 #contposy+450" if a crafting gump on OSI). Don't forget to wait until the Gump returns after making the shovel before you move to the next one. I would also suggest eliminating #contkind.

I use a "ClickAndWait" sub which clicks where you want it to click and waits for the Gump to respond before moving on to the next line of code. Fell free to check out my standard subs in my script library, maybe it will help.

X

I use
 
Code: [Select]
click #contposx #contposy f r
to close everything with no issues, though I haven't tried it on runebooks because of their oddball #contsize

I also use #contkind and #contsize quite liberally with no issues, and on my miner I have pulled the check values out and put them in the header, so any user could readily change their values if needed.

I agree it's not the simplest approach, but it's the only way I've found to achieve the performance I want

*edit*

PEBKAC at top

33
The Ghost got it mostly right, but I'm going to rewrite the sub the way I would do it:

Code: [Select]
sub auto_insure
   set !lpc #lpc  
   set #lpc 1
   finditem  * c_ , #backpackid
   set #lpc 10
   for #findindex 1 #findcnt
   {
      if #findtype notin ckf_twf_ ;add more things to this that do not need to be insured, and are in your backpack... ckf is for bag types. twf is for shovels, etc, etc...
      {
         wait 10   <--- this is so #property updates, may need to raise it, I wouldn't go lower than 10
         event property #findid
         if legendary in #property && insured notin #property <--- chage this or add more like: || blahblahblah in #property && insured notin #property
         {
            exevent popup #charid
            click x y ;---need to figure out where the x and y coords are for toggle item insurance on your shard
            wait 10
            set #ltargetid #findid
            set #ltargetkind 1
            target
            event macro 22 0
            key esc
         }
      }
   }
   set #lpc !lpc
return

#property is a PITA. I've just hashed this out while working on my BOD Filler. The above SHOULD work, but it will be relatively slow, as wait 10 = 500ms or .5 seconds, and is passed everytime something is scanned in your backpack (for every item). I've encapsulated the function in an if notin statement, adding more things like runebooks, spellbooks. etc to the not to be insured list will make it waaay faster.

Hope this helps, I'll check in later.

- Lydaan

*edit*

LMAO  :D :D :D

KISS = Keep It Simple Stupid

34
Scripting Chat / Re: #contblah issues
« on: February 03, 2016, 11:54:18 AM »
The issue actually turned out to  be EUO... or UO... or something... anyway, here's what I tried:

Code: [Select]
while #contkind <> gjz
   {
   }
   click #contposx #contposy f r
   set %timeout1 #systime
   while #contkind <> gjz && #systime - %timeout1 < 4000
   {
   }
   wait 20
   tinkerreturn:
   if #contkind = gjz
      click #contposx #contposy f r

I doubled down on the click r... no fix, so I added that 4 second wait in there to see what was going on. I have no idea why it was doing this, but it stored the gump, hidden, and as soon as the sub returned it opened the gump again... wth... anyway, adding a goto at the point of return seems to have fixed the problem. I have no clue, but it's closing now


35
Scripting Chat / #contblah issues [SOLVED] - PEBKAC
« on: February 03, 2016, 11:17:48 AM »
having a hard time with #contthings... everything was working fine until I realized the "save diskette icon" wasn't working and my last week of edits disappeared.  :'(

In my miner, after crafting a shovel, the crafting gump isn't dissapearing (this issue is due to #lpc stuff that I need to work out), but it seems that when my miner recalls, it pushes the craftgump behind something, and #contthings do not work on it.

Just wondering if anyone knows of a priority of different gumps and which one is currently on top, or had similar issues?

*edit*

Yay learning!

The propblem was 100% PEBCAK

paraphrase:

Code: [Select]
finditem twj * c_ , #backpackid
set %digshov #findid
if #findcnt = 0
   gosub tinkershovel    <--- sets tool kit as #lobjectid
set #lobjectid %digshov <--- %digshov is null, so it defers to the previos #lobjectid
event macro 17 0
...

yay learning! Glad I could share.

36
Scripting Chat / Re: Crafting menu move with screen
« on: February 03, 2016, 11:05:59 AM »
That's odd for crafting gumps

I know bags do that, and nextcontpos x y only seems to work with the backpack, so my remedy has been to force the gump in question to where I want it for the clicks:

Code: [Select]
positioncraft1:
contpos %craftgumpposx %craftgumpposy
if #contposx <> %craftgumpposx && #contposy <> %craftgumpposy
   goto positioncraft1

I really only did this so I could pull the set click values out of the loop so people could readily change the clicks as needed.

Not really an answer to your question, but I would bet only cheffe/ the maker's of the UO UI could answer that.

-edit-

On reread, it sounds like you dragged the gump with your mouse at some point... Gumps can only PERMANENTLY be moved with the mouse, or using click x y D click MC r, or probably event drag/drop... (not exevent drag/drop)

37
Scripting Chat / Re: Finditem on dual tabs on easyuo
« on: January 22, 2016, 09:42:22 AM »
The finditem returns will be local to each 'tab,' but euo can only process one thing at a time since it depends on the client to return the information. finditem is a really slow and somewhat intensive function in euo, and will likely interfere with your other scripts. I'm about at the same place where you're at with multiple scripts running together, and can tell you it's time to learn about globals...

http://wiki.easyuo.com/index.php/Documentation#Namespace


The only thing that I run independantly is my bandage script, as other than targeting, it does not interfere with any other client function.

I'm no expert when it comes to globals, yet, but I can tell you you probably need to send global pauses to pass the processing to whichever script needs to run finditem

*there are a handful of helpful threads here at scriptuo dealing with global namespace

38
Scripting Chat / Re: Fire Beetle Math help please
« on: January 20, 2016, 11:23:45 AM »
Ok, I'd be reeaal interested to know how this works on OSI...

I've got "no metal" returning in under 200ms, but successful dig/ "you loosen" is another story.

This is what I have right now:

Code: [Select]
repeat
{
   ;dig action stuff
   set %digwait #systime
   ...
   jup:
   ;journalscan stuff
   ...
   if %jup + 1 >= #jindex
   {
      if #systime - %digwait > 750 <--- ;succesful dig/"you loosen" timeout/return
         goto stopdigging
      goto jup
   }
   stopdigging:    
}
until %1 = stop

I've set the succesful dig timeout to 750ms to combat the issue in question dealing with FS/OSI, and I'll try to explain as best I can.

Succesful digs seem to require some sort of server return, and here's why I think that's true (I'll add my sysmessage output to illustrate timing). Setting the timeout low, like 500ms, results in journal output of:

Quote from: Client Journal
sys: mining at some spot
Where do you wish to dig?
sys: looptime = 520ms  <---- this return is the issue... nothing dug, just returned and tried again
sys: mining at the same spot
Where do you wish to dig?
You put some... <----- this is actually the return from the first dig, but it took too long and tried again
sys: looptime = 522ms

Setting the timeout higher results in less occurences of returns without ore, and setting it high enough eliminates those fails altogether. ;waiting for the journal to update after a succesful dig results in looptimes of over 1 second, so the timeout is faster

The point to setting it higher (or maybe extremely low if you don't mind spam, like 250ms just above the "no metal" return) is to not waste time, as in everytime it returns before having dug, the timeout is doubled:

Quote from: Client Journal
sys: mining at some spot
Where do you wish to dig?
sys: looptime = 520ms  ;wasted time...
sys: mining at the same spot
Where do you wish to dig?
You put some...
sys: looptime = 522ms

total time to complete 1 dig = 1042ms, so setting the timeout a little higher (like 800ms) results in a faster return overall than setting it lower, as you get less of those "misses" that double the time, AND this is where it might differ on OSI.

Quote from: Endless Night
sometimes you could dig faster than the result messages appeared, but the messages would eventually catch up

My interpretation of this looks like:

Quote from: Client Journal
Where do you wish to dig?
Where do you wish to dig?
Where do you wish to dig?
You put some...
You put some...
You put some...

If you do in fact retain a 1:1 ratio of digs to ore, then yes OSI does allow you to dig faster than my FS, but if it looks something like:

Quote from: Client Journal
Where do you wish to dig?
Where do you wish to dig?
Where do you wish to dig?
You put some...
You put some...
Where do you wish to dig?
Where do you wish to dig?
Where do you wish to dig?
You put some...
Where do you wish to dig?
Where do you wish to dig?
You put some...

you're wasting time with those "misses," as whatever your wait time is between attempts, it gets doubled for every return before success.

so, back to the original topic, I will try the dig smelt dig smelt thing (as it still may be possible), but the finditem return might take too long to make it efficient...

EN, I'd really appreciate some confirmation (if possible) on the journal output. ;don't worry about it too much

39
Scripting Chat / Re: Fire Beetle Math help please
« on: January 19, 2016, 02:15:36 PM »
well, this may be true on my fs as well... production seems to be down about 20% or more.

the 1 second rule, I've read all over the place, and I believe I've even seen TM post this on someone elses discontinued miner here.

so, should I really be looking for the "you must wait..." action cap? originally using wait 14 seemed to cause my miner  to dig really fast, but also skip a dig every now and then, going by the target click onscreen and the weight in the status bar.

*edit
need to add that wait 14, and even wait 10 did not produce "you must wait..."

40
Scripting Chat / Re: Fire Beetle Math help please
« on: January 17, 2016, 12:42:18 PM »
from the top...

I follow one guideline when it comes to working on my miner: The dig routine is king
Any action that's not either recalling to the next spot or dropping off at secure, like making shovels, smelting, etc. is time wasted on not mining. Yes, these are support functions that are necessary, but I believe this can be optiomized (and I know it can on my free shard, and would be willing to bet some actions will also work on OSI), and these functions can be absorbed into the actual dig routine.

Following the logic of "a tile may only be mined once per second," from what I've seen, most dig routines look someting like (semi-pseudo code):

Code: [Select]
dig:
finditem %shovel * c_ , #backpackid
set #lobjectid #findid
event macro 17 0
target
set #ltarget x/y/z
...
event macro 22 0

wait 20     <------------------  this is what i don't like

goto dig   

Using the same "once per second," logic, there is another way to set up a wait timer of 1 second (semi-pseudo code):

Code: [Select]
dig:
finditem %shovel * c_ , #backpackid
set #lobjectid #findid

digwait:
if #systime - %digwait < 1000    <---------------------   variable wait timer
   goto digwait

event macro 17 0
target
event macro 22 0
set %digwait #systime
goto dig

I initally switched to this variable style of wait timer because of the variance that I was seeing from finditem returns, and by setting it up this way, I'm able to ignore the finditem return time. But rather than ignore, I realized it's more like ABSORB. And once I realized this, I realized I could cram all sorts of functions into this loop as long as they don't push the dig routine past one second, and gain in efficiency.

... fast forward to this thread and the firebeetle....

Quote
But reading above it sounds like you smelt after every dig

This had sort of crossed my mind, but I didn't give it any serious thought, until EN posted this.

Now, back on topic...

My experience on my Free Shard is that smelting has no real cooldown, just ping related response, so I'm able to smelt ALL my ore like this:

Code: [Select]
      finditem %oretypes * c_ , #backpackid
      for #findindex 1 #findcnt
      {
         if #findcol notin 2219_1174_1152_1153_1272_1278 ; this is the skipper I currently use to not smelt valorite and bonus ore on the fly
         {
            set #lobjectid #findid
            event macro 17 0
            target
            set #ltargetid %firebeetleid
            set #ltargetkind 1
            event macro 22 0

            wait 6   <------------- 300ms... just over my ping

         }
      }

This is what I know about smelting on the Fire Beetle:

Code: [Select]
      if #weight > %carryweight
      {
         gosub firebeetle smelt
         wait %genericwait
         if #weight > %carryweight - 100
         {
            gosub firebeetle mount
            gosub travel home
            gosub secops
            gosub firebeetle mount
            gosub travel back
            gosub firebeetle dismount
         }
      }

writing my smelt routine like this resulted in a range from 700ms - 2100ms. ALL of the variance due to how many DIFFERENT ores there were at the time of smelting... so, 1 ore type = 700ms

so, I tried this:

Code: [Select]
repeat
{

   ...

     digwait:
     if %loopspeedcheck < %digloopupperbound
            goto digwait
      event sysmessage mining at Book %bookcnt Rune %runecnt Vein %onvein
      finditem %digtools * c_ , #backpackid
      set #lobjectid #findid
      event macro 17 0
      target
      event macro 22 0
      set %reploopcheck #systime
      set %digwait #systime

...

if There_is_no in #journal

...

finditem %oretypes * c_ , #backpackid
      if #findcnt > 0
      {
         for #findindex 1 #findcnt
         {
            if #findcol notin 2219_1174_1152_1153_1272_1278
            {
               set #lobjectid #findid
               event macro 17 0
               target
               set #ltargetid %firebeetleid
               set #ltargetkind 1
               event macro 22 0
               goto stopdigging
            }
         }
      }

...

   stopdigging:
}
until %1 = stop

and my mule is still pounding dirt every second (#systime checked)... so it's possible at least on my freeshard to dig smelt dig smelt continuously, and depending on the "use ore," cooldown on OSI, it may be possible on there as well.

Quote
I don't see how that would be possible. You're smelting many fewer times by only smelting when the pack is full.

true, but that time is time spent not digging. By incorporating smelting into the 1 second dig wait, there is literrally no time lost in the total operation of the script... that .7 - 2.1 seconds to smelt is now essentially 0 seconds.

Quote
Wait a sec you said on your  FS   as in free shard.....   well that might explain it.

Yes, this is always a possibilty, but I think you may be surprised. The ability to dig smelt dig smelt hinges on the fact that there is no real cooldown for smelting on my FS, and i didn't even write in a wait after it smelts in the digroutine... If you can spam smelt on OSI, this should be possible, but you'll have to check out the snippet about smelting in general up above.

Quote
How does that effect the % of ingots you get .

so my FS is a little weird. Valorite seems to be 100% smeltable at 105 mining. We have bonus ores Blaze, Electrum, Toxic, and Platinum. Blaze being the only one I can mine because my skill isn't high enough.

We also have another pair of leather mining gloves that are +20, so Blaze seems to be 100% smeltable at mining 120.. My miner with the +20 gloves smelts everything except the ores I can't get yet, and my miner with the +5 gloves smelts valorite and below, only... If I lost some I wouldn't know because I don't track ores, because I literrally have multiple 60k stacks of everything... but it seems to be 2 ingots per 1 ore, with incredibly low failure rate.

41
Scripting Chat / Re: Fire Beetle Math help please
« on: January 16, 2016, 12:23:50 AM »
Well, speedtested and currently running... on my FS I CAN actually dig and smelt the dug ore in under 1000ms... (#systime checked)... my guess is about 600% efficiency gain  ;D

not real sure on the math, but I know 10 ingots weighs 1 stone, and 11-20, 21-30, etc ... weighs +1 stone, each;
1 ore weighs 12 stones, so:

Code: [Select]
12 stones of ore =~ .2 stones ingots

I'll post up something later, going camping for a couple days

*edited* for coherency

42
Scripting Chat / Re: Fire Beetle Math help please
« on: January 12, 2016, 04:30:56 AM »
Thanks for the replies! ... was losing hope.  ;)

Been busy with my lumberjacker, so I haven't messed with this yet, but was more a concern when I first got my firebeetles and didnt't set a secure drop limit, and watched all the efficiency burn up as they got close to maxweight. :o

Quote
But reading above it sounds like you smelt after ever dig

I don't actually smelt after every dig, just the maxweight approach. I haven't speed tested it, but if I could dig and smelt within 1250ms (reliably) I would, as that's currently what my dig cycle is set to after ping compensation, and there would litereally be exponential efficiency gain, but I don't think I can and therefore an efficiency loss.

Quote
On the other hand that is 2000 ingots you aren't going to have when you head home to dump.

LMAO

I'm pretty sure if you didn't set an upper limit, your miner could just stand in the same spot, continuously digging/smelting and the resource respawn would beat YOU.


So right now, it's set to weight. I WILL be setting it to time based as I described at the end of my first post, where I sum the time of smelts (after reaching maxweight), and when one more smelt would make the sum greater than the time to drop at secure, I head home. The variance is so high (.7s min - 2.1s max) that i think this is the best *simple* approach. I could create a calculus formula to compare the 2 growth rates (ingot growth vs sum of smelt time growth), but after discussing with some friends, that would only increase the efficiency by something like 5 mins (it's most definitely under 10mins) in a week of operation (168hrs, so <.001% )... not worth it, until I get other stuff done, then I might check my math, but I doubt it.

----------------------------

After thought.

Anyway, I appreciate the input and it's very nice having a place (thanks TM) to discuss these matters "outloud," (even if I do just end up talking/typing to my screen). I'm glad this was discussed, because one player keeps killing one of my mules and it's beetle (using a gargoyle's pick axe), so the math will apply when I switch to a portable smelter and a Greater Dragon or Cu Sidhe for defense.

43
Scripting Chat / Fire Beetle Math help please
« on: January 08, 2016, 01:32:04 AM »
Been working on my miner. Then I hardcoded the use of a giant beetle in it.... THEN I got 2 firebeetles (for 2 accounts)... going to be a minute before I post my miner, but am hoping someone can help me set up an equation to min/max the use of the fire beetle. I've been smashing my face on my desk for a couple days on this one.

Here's what I know:
minus the occasional ping spike, my miner digs once every second (95% confidence).
I roll humans, and experience 80% or more pulls of 2 ore per dig @ 24 stones
My mules empty are about 60 stones, full 555 stones.
I haven't done the math to figure out exactly how much ingots weigh, but 9/10 stones is close enough, although I believe this to be irrelevant.
Based on an average of 112 readings, smelting on the beetle takes an average of 1.135 seconds (.7min - 2.0max)
Based on a small number of readings, trips to the secure with the firebeetle take roughly 20 seconds.

I currently have my mules set to go home at >405 stones (max-150), this is due mostly to only having my highest skilled miner smelting everything on the fly and the other dropping valorite+ ore in the secure to be smelted by my other miner. But, this is also due to the ever increasing diminishing return on smelting on the fly... which by its nature is always increasing (diminishing) after the first smelt since the bagweight increases.

So... I could try and set-up a growth curve taking into account the weight of the ingots, but I think a rough estimate is good ecough since lag and other outside influences are a factor, and I believe the weight of the ore and the time to smelt/drop are WAY more important.

My gut is telling me that MAXWEIGHT - 200 stones is really where I should be heading to secure, as that is roughly 10digs at ~20 stones per dig...

10digs = 10seconds + 1second for smelting > 1/2 the time to drop at secure (10 seconds)...

I just can't believe that digging once then smelting for a total of ~2 seconds percycle until I reach my %carryweight target to go to secure to be beneficial... that can't be right, can it? So if it's not... what is the target weight to head to secure???

It's been a couple years since I've had to do real math (not accounting), and I feel I'm just missing an important component.

Thanks,

Lydaan

*edit* - its late.. forgot something

The other way i was thinking of doing this was counting smelts. ie go to secure after the 18th or 19th smelt as the total additional time is <= the time to drop...

----------------

Feel like I'm talking to wall, but sometimes it's helpful to see things laid out in front of you. So this is what I'm going to do.

I'm just going to assume 20secs for a secure drop for the first run, then I'm going to setup a timer for secure drops to take an average of the time it takes. Then I'm going to setup a timer for smelts and sum the time for each smelt, and after the first run, it'll be variable based on an average of how long secure drops take.

something like:

Code: [Select]
if %smeltsum > %avesecdrop - 1000 ;1second....
   gosub securedrop

44
Scripting Chat / Re: LPC for finditem and event property
« on: January 01, 2016, 10:49:56 AM »
So for EN and anyone else interested... I've figured out how I wanted to do my journal update wait.

If TM's sub is the "Advanced," version... then this is the "get a bigger hammer" remedial version of journal scanning:

Code: [Select]
     event sysmessage mining at Book %bookcnt Rune %runecnt Vein %onvein
      finditem %digtools * c_ , #backpackid
      set #lobjectid #findid
      set %jupdate #jindex + 1
      event macro 17 0
      target
      event macro 22 0
      set %digwaitbegin #systime

...

      jup:
      scanjournal #jindex
      if There_is_no in #journal
      {
         if #weight > %nrweight && %onvein = %veincnt && %stripmine = no
         {
            gosub travel home
            gosub secops
         }
         set %stopdigging now
         goto stopdigging
      }
      if You_have_worn in #journal
      {
         gosub checkingots
         gosub tinker shovel
      }
      if That_is_too in #journal || Target_cannot in #journal
      {
         event sysmessage Whoops, travel broke... HOLD ON
         gosub travel nextrune %runecnt
         set %stopdigging now
         goto stopdigging
      }
      set %endcheck #systime - %digloopwaitcheck
      set %digwaitend ( #systime - %digwaitbegin )
      if %digwaitend > 300 && %endcheck > 980
      {
         ;event sysmessage %digwatend | %endcheck
         goto keepdigging
      }
      goto jup

The only way I've broken it so far is if I spam event sysmessages during the update loop... I believe it should be fast enough to read through the global chat spam on my server... and if not, I'll just turn global chat off...

*edit* oh, and by moving to scanjournal dependant catches, I was able to improve my move to nextvein rate by about 30%... it catches the "no_metal" at about an average of 200ms (was a "wait 6..." ~315ms), and moves to the nextvein at an average of about 650-750ms.

Pretty happy with the results

45
Scripting Chat / Re: Travel... needs a discussion
« on: January 01, 2016, 10:36:25 AM »
Thats strange it shouldn't make any difference..

........ well.......  >:( >:( >:(............ ONE week of head smash keyboard down..............

Quote
The only times to my knowledge that you must use {}  on an if... is if you have more than one line of code to execute after the condition is met or if you use an else command
 ie   if ... { }  else { }.

in my experience else doesn't need brackets either if it's one line....

Code: [Select]
if stuff true
   do this
else
   do that

BUT....  >:( >:( atleast I found another EUO bug to look out for....

Pages: 1 2 [3] 4 5