Author Topic: Journal scanning for spell timer  (Read 3274 times)

0 Members and 1 Guest are viewing this topic.

Offline Scotch_Tape

  • Jr. Member
  • **
  • Posts: 55
  • Activity:
    0%
  • Reputation Power: 1
  • Scotch_Tape has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
Journal scanning for spell timer
« on: May 03, 2009, 07:38:32 PM »
0
I'm having problems making this work all the time.  It somehow works sometimes, but gets hung up because I didn't pay attention back in the one program related class I had in high school and decided instead to sleep or not show up.

I am just now working with this whole "return #True" and "#return #False" business.  I think I'm using it wrong so please break it down barney style if at all possible.


set %JINDEX #JINDEX
  event macro 15  10
gosub JournalTimer 3


sub JournalTimer
  set %OldLPC #LPC
  set #LPC 100
  set %InternalTimer #scnt + %1
  While #TARGCURS <> 1
    {
      set %JINDEX #JINDEX + 1
      ScanJournal %JINDEX
      if ruining_thy_spell in #Journal || %InternalTimer < #scnt
        {
        set #LPC %OldLPC
        Return #True
        }
      while %JINDEX > #JINDEX && #TARGCURS <> 1
      wait 1
    }
return #False




« Last Edit: May 04, 2009, 05:27:03 AM by Scotch_Tape »

Offline Superslayer

  • Elite
  • *
  • *
  • Posts: 1006
  • Activity:
    0%
  • Reputation Power: 14
  • Superslayer barely matters.Superslayer barely matters.
  • Gender: Male
  • Well what do you drink? Not tea.
  • Respect: +43
  • Referrals: 0
    • View Profile
Re: Journal scanning for spell timer
« Reply #1 on: May 03, 2009, 08:12:47 PM »
0
Perhaps I can help, ...I hope.  The first thing I see, is that you set the lpc to a higher than default level before scanning the journal. I believe that for the journal to find anything, you'll have to give it enough time to react to any actions your client is sending to the server, and time for the client to respond. So perhaps putting in a little 'Wait 5' or 'Wait 3' after the ScanJournal %JINDEX will help to insure that the sub will have the time needed to read and react accordingly.  I also think that you should have the lines "ScanJournal %JINDEX" and "set %JINDEX #JINDEX + 1" switched. I may be wrong on that one, but it looks 'off' to me. 

Regarding your usage of return #false/#true, it's completely up to you how you want to respond to those values. Your usage is correct in that if you find that the journal entry IS in there, you return a #true value, and you evaluate what to do in the sub from which it came, and vice versa.

Offline Scotch_Tape

  • Jr. Member
  • **
  • Posts: 55
  • Activity:
    0%
  • Reputation Power: 1
  • Scotch_Tape has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
Re: Journal scanning for spell timer
« Reply #2 on: May 04, 2009, 05:23:51 AM »
0
The first thing I see, is that you set the lpc to a higher than default level before scanning the journal. I believe that for the journal to find anything, you'll have to give it enough time to react to any actions your client is sending to the server, and time for the client to respond.


Well,  The scan is only going to go if the #JINDEX changes anyway, so I can't imagine it going faster than EasyUO would be able to update that variable.  I may be wrong, but I thought all speeding it up would do is make it process the information faster.  The whole idea is to find out the split second a spell is fizzled and retry to cast.  Before this I had been using the "Target [seconds]" which worked great, but it was slow when I was getting fizzled by crap.

Quote
I also think that you should have the lines "ScanJournal %JINDEX" and "set %JINDEX #JINDEX + 1" switched. I may be wrong on that one, but it looks 'off' to me.
 

I noticed any example had it like that.  In my mind it seemed like I would be missing a line in the journal, but I changed it so it's now before.  I will update the sub I posted with my change.  Thanks for the input.  I can actually run this, but it just seems to get sluggish and I'm thinking I'm just doing something wrong. 

I am trying to scan the journal until there is a target cursor, if I get interupted for any reason I want to instantly return to cast the spell again.  Thanks again!


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: +393
  • Referrals: 1
    • View Profile
Re: Journal scanning for spell timer
« Reply #3 on: May 04, 2009, 07:23:29 AM »
0
didnt read all above but this should make it work ..  :)

Code: [Select]
set %JINDEX #JINDEX + 1
  event macro 15  10
gosub JournalTimer 3

sub JournalTimer
  set %OldLPC #LPC
  set #LPC 100
  set %InternalTimer #scnt + %1
  While #TARGCURS <> 1
    {
      IF  %jindex <= #Jindex
        {
        ScanJournal %JINDEX
        set %JINDEX %JINDEX + 1
        if ruining_thy_spell in #Journal || %InternalTimer < #scnt
          {
           set #LPC %OldLPC
           Return #True
           }
         }
     ELSE
        {
        wait 1
        }
    }
return #False

« Last Edit: May 04, 2009, 07:25:48 AM by Endless Night »
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."

Tags: