-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathall.py
More file actions
79 lines (62 loc) · 2.25 KB
/
all.py
File metadata and controls
79 lines (62 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Общий модуль, включает набор функций используемых большинством скриптов.
# v0.1 made by 80aX for ZHR
from stealth import *
from datetime import datetime, timedelta
def Hungry():
if not Connected() or Dead():
AddToSystemJournal("Cannot check hungry state, character is not connected or dead.")
return 0
state = [
'You are absolutely stuffed!',
'You are stuffed',
'hungry at all',
'You are a little hungry',
'You are somewhat hungry',
'You are REALLY hungry',
'Your stomach hurts',
'Your stomach hurts and you feel dizzy',
'You are starving',
'You are almost dying of hunger',
'You are DYING of hunger...'
]
foodtype = 0x097B
pcstoeat = 0
ctime = datetime.now()
UOSay('.hungry')
if (WaitJournalLine(ctime, '|'.join(state), 10000)):
for i in range(2, len(state)):
if InJournalBetweenTimes(state[i], ctime, datetime.now()) > 0:
pcstoeat = i - 1;
break
else:
AddToSystemJournal('Cannot check hungry state... Lag?')
return 0
if pcstoeat > 0:
for i in range(pcstoeat):
if not FindType(foodtype, -1):
AddToSystemJournal("No food found!")
return 0
UseObject(FindItem())
Wait(100)
return 1
def CheckSave():
time = datetime.now() - timedelta(0, 30)
if InJournalBetweenTimes('Сохранение мира.', time, datetime.now()) >= 0:
Wait(10000)
def WaitConnection(waittime):
if Connected():
return
while not Connected():
Wait(1000)
Wait(waittime)
def FullDisconnect():
SetARStatus(False)
Disconnect()
def CheckTargetError(lines, checktime):
# 5 minutes in DateTime = (1.0 * checktime) / 1440 = 0.00347
ctime = datetime.now() - timedelta(0, 60 * checktime)
InJournalBetweenTimes('I am already performing another action|doing something', ctime, datetime.now());
if LineCount() > lines:
AddToSystemJournal('Error with target. Disconnected')
ClearJournal()
Disconnect()