Counting in hex
Posted: 2006-07-20 07:23:49
Is there a way to count or convert decimal numbers to hex? i'm using a script that i need to have values from 1-ffff and i don't want to manually write conversion code if it already exists.
Code: Select all
i='0f00'
hex='0x'+i
Code: Select all
uo.Int2Hex(number)
uo.Hex2Int(text)I guess you need som' mega expert help and btw why do you need such thing ? Yea' and I'm not pretty shure that its imposibleUmuri wrote:*sigh*
let's try this one more time. Again, i apologize for being unable to write this in russian, as i'm pretty sure that's the language barrier.
UO.hex2int gives an output of the form 0x0000.
I need an output just in the form of 0000.
Is there a way to format uo.hext2int so that it does not have 0x in front?
very nice... I hope that the experts will help you or find another way to do itUmuri wrote:I'm writing a program to catalogue all items in the shard.
UO.say(".add " + var)
where var is every number between 1 - 9999.
It then finds the item on the ground, pulls info from it which is sent to a text window, which another program i have pulls from and puts into a database.
Essentially just another way to make sure no items have slipped into the worldfile through bugs, except this oen can run during the night while i'm sleeping and then i can jsut compare the two databases the next day to see any changes.
Code: Select all
for i=0 to 65535
UO.Say(".add " + UO.Int2Hex(i))
nextCode: Select all
VAR hexnum
VAR num
num=Int2Hex(i)
hexnum=num[2]+num[3]+num[4]+num[5]
Code: Select all
sub itemfinder()
VAR hexnum
VAR num
var i
var BackP = 0x4000D00E # ID of your backpack, to cancel targetting
var itemName
var itemTemp
uo.textopen()
uo.textclear()
UO.DeleteJournal()
for i=1 to 65535
num = uo.Int2Hex(i)
hexnum=num[2]+num[3]+num[4]+num[5]
uo.waittargetobject(BackP)
UO.Say(".add " + hexnum)
UO.DeleteJournal()
while not UO.Injournal("would you like to place")
wait(100)
wend
wait(300) # included to cut down on spam filter
itemTemp = uo.journal(uo.injournal("would you like to place")-1)
itemName = mid(itemTemp,34,len(itemTemp)-35)
uo.textprint("Item Number " + hexnum + " is: " + itemName)
next
end sub
Code: Select all
uo.canceltarget()Code: Select all
sub itemfinder()
VAR hexnum
VAR num
var i
var BackP = 0x4000D00E # ID of your backpack, to cancel targetting
var itemName
var itemTemp
uo.textopen()
uo.textclear()
UO.DeleteJournal()
for i=1 to 65535
num = uo.Int2Hex(i)
hexnum=num[2]+num[3]+num[4]+num[5]
uo.waittargetobject(BackP)
UO.Say(".add " + hexnum)
UO.DeleteJournal()
while not UO.Injournal("would you like to place") and not UO.Injournal("a valid command")
wait(100)
wend
wait(300) # included to cut down on spam filter
if UO.Injournal("would you like to place") then
itemTemp = uo.journal(uo.injournal("would you like to place")-1)
itemName = mid(itemTemp,34,len(itemTemp)-35)
uo.textprint("Item Number " + hexnum + " is: " + itemName)
end if
if UO.Injournal("a valid command") then
uo.textprint("Item Number " + hexnum + " does not exist. ***********")
end if
next
end sub