Author Topic: Scan Journal Sub 0.1 for Public Testing  (Read 2121 times)

0 Members and 1 Guest are viewing this topic.

Offline VicVegaTopic starter

  • Jr. Member
  • **
  • Posts: 71
  • Activity:
    0%
  • Reputation Power: 0
  • VicVega has no influence.
  • Respect: +8
  • Referrals: 0
    • View Profile
Scan Journal Sub 0.1 for Public Testing
« on: May 18, 2009, 07:58:43 AM »
0
Code: [Select]
;=================================================================
; Script Name: Scan Journal Sub
; Author: VicVega
; Version: 0.1
; Shard OSI / FS: UO Legends
; Revision Date: 18/5/2009
; Purpose: Looks for a text in the journal and returns it
; Globals: None
;=================================================================
; Instructions:
; You call the sub with the messages you want to look for.
; If it finds one of the messages you are looking for, the sub returns
; and #result variable saves the message found
; Tries to find the messages during the time marked by %maxTimeOutScan
; %maxTimeOutScan value it's 15 seconds by default
; Call example: gosub scan message1 message2 message3 ...
;************************* Sub **********************************
sub scan
  set %maxTimeOutScan 15
  set %timeout #scnt + %maxTimeOutScan
  set %jrnl #jindex
  scanjournal %jrnl

  while #scnt < %timeout
  {
    if %jrnl < #jindex
    {
      set %jrnl %jrnl + 1
      scanjournal %jrnl
    }

    for %journalCounter 1 %0
    {
     if % . %journalCounter in #journal
       return % . %journalCounter
    }
  }
return
To learn, read.
To know, write.
To master, teach.

Tags: