Code: Select all
var MaxWeight = 300
var Wool = '0x0DF8'
var BlankScroll = '0x0E34'
var TinkTool = '0x1EBC'
var ScrollDelay = 7000
var Logs = '0x1BDD'
sub main()
VAR EatTimer
EatTimer = 0
Init('simple blank scroll making','0.99a','totus')
REPEAT
CheckSave()
if ((UO.Timer() - EatTimer) >= 6000) Then
UO.Print('I?iaa?ea aieiaiinoe')
EatCheck()
EatTimer = UO.Timer()
endif
UO.WaitTargetGround(Logs)
UO.Recall('self','3636')
UO.UseType(TinkTool)
Wait(ScrollDelay)
CheckDrop(BlankScroll)
UNTIL false
end sub
sub Init(sName, sVer, sAuthor)
#----------------
UO.TextOpen()
UO.TextPrint('Ne?eio noa?oiaae: '+MakeTime())
UO.Exec('terminate Reconnector')
UO.Exec('exec Reconnector')
#----------------
Wait(1000)
UO.Print('An exceptional '+sName+' script v'+sVer+' [crafted by '+sAuthor+']')
Wait(1000)
#----------------
UO.Set('norbcheck','1')
UO.Set('norbcalc','1')
UO.Set('nogump','1')
UO.Set('distance','2')
UO.ConColor(0x0094)
end sub
sub CheckDrop(wtDrop)
if (UO.Weight > MaxWeight) then
Stack(wtDrop,'-1')
Wait(500)
endif
end sub
sub Stack(StackType,Color)
var GroundItem, PackItem, GrndTmp
PackItem = ''
GroundItem = ''
if UO.Count(StackType) then
PackItem = '^'+StackType
endif
if UO.CountGround(StackType) then
UO.IgnoreReSet()
repeat
UO.FindType(StackType,Color,'ground')
if UO.FindCount() then
GrndTmp = UO.GetSerial('finditem')
if (UO.GetQuantity(GrndTmp) > 55000) then
UO.Ignore(GrndTmp)
else
GroundItem = GrndTmp
endif
endif
UO.FindType(StackType,Color,'ground')
until ((UO.FindCount() == 0) or (GroundItem <> ''))
endif
if ((PackItem <> '') and (GroundItem <> '')) then
UO.MoveItem(PackItem,STR(UO.GetQuantity(PackItem)),GroundItem,'0','0','0')
else
UO.DropHere('^'+StackType)
Endif
end sub
var HungerDeadLine = 9
sub EatCheck()
var GHS, Hung_i, Meal
GHS = 0
Meal = '0x097b'
GHS = GetHungryStatus()
If (GHS > 1) then
For Hung_i = 0 To (GHS - 2)
Eat(Meal)
Wait(350)
Next
EndIf
end sub
sub Eat(wtEat)
If UO.Count(wtEat) then
UO.UseType(wtEat)
else
If UO.CountGround(wtEat) then
UO.UseFromGround(wtEat)
else
UO.Print('No meal found.')
If (GetHungryStatus() == HungerDeadLine) then
UO.CloseUO()
endif
endif
endif
end sub
sub GetHungryStatus()
VAR Ret_i, Cycle_i, LastStr
DIM HArr[11]
HArr[0] = "You are absolutely stuffed!"
HArr[1] = "You are stuffed"
HArr[2] = "You aren't hungry at all"
HArr[3] = "You are a little hungry"
HArr[4] = "You are somewhat hungry"
HArr[5] = "You are REALLY hungry"
HArr[6] = "Your stomash hurts"
HArr[7] = "Your stomash hurts and you feel dizzy"
HArr[8] = "You are starving"
HArr[9] = "You are almost dying of hunger"
HArr[10] = "You are DYING of hunger..."
UO.DeleteJournal()
UO.ServerPrint(".hungry")
Ret_i = 0
Cycle_i = 0
Wait(400)
For Cycle_i = 0 To 10
If CheckMsg(HArr[Cycle_i],'System') Then
Ret_i = Cycle_i
EndIf
Next
RETURN Ret_i
end sub
sub CheckMsg(cMsg, mAuthor)
if IsNumber(mAuthor) then
mAuthor = UO.Int2Hex(VAL(STR(mAuthor)))
endif
var ij
ij = UO.InJournal(cMsg)
if ij Then
if ((UO.JournalSerial(ij-1) == mAuthor) or (UO.GetName(UO.JournalSerial(ij-1)) == mAuthor)) then
return ij
else
if (mAuthor == 'System') and (UO.JournalSerial(ij-1) == '0x01010101') then
return ij
else
return 0
endif
endif
else
return 0
endif
end sub
sub CheckSave()
If CheckMsg("Saving World State",'System') Then
UO.TextPrint("WorldSave: "+MakeTime())
UO.DeleteJournal()
Wait(25000)
EndIf
end sub
sub Reconnector()
var ReconnectTime, RFlag
ReconnectTime = '0'
RFlag = 1
Repeat
While (UO.ObjAtLayer('Bpack') == '')
if RFlag Then
ReconnectTime = MakeTime()
RFlag = 0
endif
Wait(20000) # WorldSave Protection
UO.Say('')
Wait(3000)
UO.Say('')
Wait(3000)
UO.Say('')
Wait(3000)
UO.LDblClick(357,164)
UO.LClick(616,459)
Wait(3000)
WEnd
Wait(3000)
if (RFlag == 0) and (ReconnectTime <> '0') Then
UO.Exec('terminate main')
UO.Exec('exec main')
UO.TextOpen()
UO.TextPrint('Disconnected & Reconnected @ '+ReconnectTime)
RFlag = 1
ReconnectTime = '0'
endif
Until false
end sub
sub MakeTime()
VAR D, T, Ret, i
Ret = STR(UO.Time())
T = ""
For i = 0 To Len(Ret)
T = Ret[Len(Ret)-i] + T
If (I == 2) OR (I == 4) Then
T = ":" + T
EndIf
Next
Ret = STR(UO.Date())
D = ""
For i = 0 To Len(Ret)
D = Ret[Len(Ret)-i] + D
If (I == 2) OR (I == 4) Then
D = "." + D
EndIf
Next
Ret = T + " @ " + D
RETURN Ret
end sub