Author Topic: LPC for finditem and event property  (Read 7191 times)

0 Members and 1 Guest are viewing this topic.

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +750
  • Referrals: 1
    • View Profile
Re: LPC for finditem and event property
« Reply #15 on: December 31, 2015, 01:55:28 PM »
0
LOL hang in their sometimes its just easier to paste in some code you know works...  ie   TM journal subs...  http://www.scriptuo.com/index.php?topic=33.0

Its common to break your own script...  I do it all the time...   I often add lines that read   display ok gOt here and x = %x     and further down  display ok got here 2 and x = %x  or such stuff  just so i can figure out whats happening....

Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline lydaanTopic starter

  • Jr. Member
  • **
  • Posts: 70
  • Activity:
    0%
  • Reputation Power: 3
  • lydaan has no influence.
  • Respect: +7
  • Referrals: 0
    • View Profile
Re: LPC for finditem and event property
« Reply #16 on: January 01, 2016, 10:49:56 AM »
0
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
« Last Edit: January 01, 2016, 11:00:25 AM by lydaan »

Tags: finditem  lpc