include timer scl include checklag scl include targets scl sub seller

  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
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#@include timer.scl
#@include checklag.scl
#@include targets.scl
sub seller()
dim horses2[20]
var horses2cnt = getShrinkedCreaturesList(horses2)
setTimer('unshrink', 0)
setTimer('sell', 0)
var horse
repeat
if (isTimerExpire('unshrink')) then
if (horseCount() > 4) then
setTimer('unshrink', 1000)
else
horse = findShrinkedHorse()
if (horse) then
uo.useObject(horse)
end if
setTimer('unshrink', 3000)
end if
end if
if (isTimerExpire('sell')) then
horse = findHorse()
if (horse) then
fixTargets()
uo.waitTargetObject(horse)
uo.say('sell')
end if
setTimer('sell', 3000)
end if
wait(100)
until false
end sub
sub horseCount()
dim horses[20]
var horsesCnt = getCreaturesList(horses)
var cnt = 0
uo.ignoreReset()
for var f = 0 to horsesCnt - 1
uo.findType(horses[f], -1, 'ground')
while uo.findCount()
cnt = cnt + 1
uo.ignore('finditem')
uo.findType(horses[f], -1, 'ground')
wend
next
uo.ignoreReset()
return cnt
end sub
sub findHorse()
dim horses[20]
var horsesCnt = getCreaturesList(horses)
for var f = 0 to horsesCnt - 1
uo.findType(horses[f], -1, 'ground')
if uo.findCount() then
return uo.getSerial('finditem')
end if
next
return ''
end sub
sub findShrinkedHorse()
dim horses[20]
var horsesCnt = getShrinkedCreaturesList(horses)
for var f = 0 to horsesCnt - 1
uo.findType(horses[f], -1, 'my')
if uo.findCount() then
return uo.getSerial('finditem')
end if
next
end sub
sub getCreaturesList(creatures)
creatures[0] = '0x00C8' #horse1
creatures[1] = '0x00CC' #horse2
creatures[2] = '0x00E2' #horse3
creatures[3] = '0x00E4' #horse4
return 4
end sub
sub getShrinkedCreaturesList(creatures)
creatures[0] = '0x2120'
creatures[1] = '0x2121'
creatures[2] = '0x211F'
creatures[3] = '0x2124'
return 4
end sub
#@autocode
#------------------------------------------------
# included file timer.scl
#------------------------------------------------
sub setTimer(timerName, expireTime)
uo.setGlobal(timerName, str(uo.timer() + int(expireTime/100)))
end sub
sub isTimerExpire(timerName)
var n = val(uo.getGlobal(timerName))
return n <= uo.timer()
end sub
#------------------------------------------------
# included file checklag.scl
#------------------------------------------------
#проверка на лаг. одиночный клик на backpack и ожидание в журнале
#слов "backpack"
sub CheckLag()
uo.deleteJournal()
uo.click('backpack')
repeat
wait(200)
until uo.inJournal('backpack')
end sub
#------------------------------------------------
# included file targets.scl
#------------------------------------------------
# отменят таргеты (в инжекте и клиенте), если они есть
sub fixTargets()
#fix injection target
if (uo.waiting()) then
uo.cancelTarget()
end if
#fix client targeting
if (uo.targeting()) then
uo.say(chr(27))
wait(50)
end if
end sub