Page 1 of 1

[Python] example for Journal reading (solved)

Posted: 27.11.2018 23:30
by sauber
Hi,

The first example, from nah nah's suggestion is just a couple of posts under.

Re: [Python] Help example for Journal reading

Posted: 28.11.2018 4:37
by nah nah
you can use events or InJournalBetweenTimes with a datetime instances

Re: [Python] Help example for Journal reading

Posted: 03.12.2018 23:00
by sauber
Hi,

one issue, I can't use Now in python, any idea what is used?

Re: [Python] Help example for Journal reading

Posted: 03.12.2018 23:05
by nah nah

Code: Select all

import datetime
now = datetime.datetime.now()

Re: [Python] Help example for Journal reading

Posted: 04.12.2018 0:48
by sauber
Thanks again!

Code: Select all

import datetime

def scanJournal():
   start = datetime.datetime.now()
   Wait(500)
   UOSay('Hello')
   Wait(100)
   if InJournalBetweenTimes('Hello', start, datetime.datetime.now())) != -1:
       AddToSystemJournal('Matching words')
   else:
       AddToSystemJournal('Not a match')