Forum in READ ONLY mode! All questions and discussions on Discord official server, invite link: https://discord.gg/VxsGzJ7

[Python] example for Journal reading (solved)

Ask for help
Post Reply
sauber
Neophyte
Neophyte
Posts: 18
Joined: 18.07.2018 21:01

[Python] example for Journal reading (solved)

Post by sauber »

Hi,

The first example, from nah nah's suggestion is just a couple of posts under.
Last edited by sauber on 04.12.2018 0:50, edited 2 times in total.
nah nah
Developer
Developer
Posts: 414
Joined: 13.07.2011 11:23
Contact:

Re: [Python] Help example for Journal reading

Post by nah nah »

you can use events or InJournalBetweenTimes with a datetime instances
sauber
Neophyte
Neophyte
Posts: 18
Joined: 18.07.2018 21:01

Re: [Python] Help example for Journal reading

Post by sauber »

Hi,

one issue, I can't use Now in python, any idea what is used?
nah nah
Developer
Developer
Posts: 414
Joined: 13.07.2011 11:23
Contact:

Re: [Python] Help example for Journal reading

Post by nah nah »

Code: Select all

import datetime
now = datetime.datetime.now()
sauber
Neophyte
Neophyte
Posts: 18
Joined: 18.07.2018 21:01

Re: [Python] Help example for Journal reading

Post 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')
Post Reply