ScriptUO
General => New member introductions => Topic started by: chaosbug on February 19, 2012, 11:40:33 AM
-
... not really sure how the rest of that song goes. But it was a catchy subject line I thought ;) The easyuo site though populated with a wide range of scripts doesn't seem to be as active as it was a few years ago. This site on the other hand has recent post dates in topics and seems to be a place I want to be. I'm digging into lua and I like what I see so far. I'm looking for access to the scripts on this site to improve my own understanding of the easyuo scripting and openUO at the same time.
Thanks for your consideration.
-
Two tears in a bucket....mother :-X! How's that for a catchy line? ;)
Welcome to the site!
What shards are you playing on and how did you find out about ScriptUO? Google?
-
Who is that girl in Ultima's avatar, and where can I see more of her?
(oh yeah - welcome!)
-
I play on Official Servers mostly Great lakes. And yeah I think I found out about scriptUO from Google while searching for type codes on gargish cloth armors.
-
I play on Official Servers mostly Great lakes. And yeah I think I found out about scriptUO from Google while searching for type codes on gargish cloth armors.
Yeah there is quite a bit information on scripts as well as tutorials and general information about Ultima Online.
One of the rules of getting full access to the site is to put forth a hearty introduction not just a few lines. We like to get to know our members. :)
What else can you tell us about yourself? Any good UO stories to share with the community?
-
About myself, feel like i'm signing up for a edating site heh. I'm 36 live in Louisiana where I work as a E&I desginer / PLC Programmer in the Petrochem Industry. I've been hacking away at code since my parents bought me a Tandy Color Computer II back in the mid 80's. I've been into UO since beta, I still have the print from the charter edition hanging on my computer room wall. I was in Krieger on Great Lakes way back in the day if anyone remembers Krieger Valley between Yew and Minoc. I took off the week charter edition came out and was one of the first if not the first GM Smith's in the game at just over 26 play hours. Our guild moved over from Dialbo enmasse so I sat in the minoc smithy and the guild would run ore from minoc mtn to me till they had a full suit of armor and weapon of their choice then they stood guard over the others that were still mining. We got way ahead of everyone else in the game doing that. Back then dragons and demons and the like would follow you through gates if you cast them between you and them. We used to fill Krieger Castle to overflowing with the baddies then go in as a guild to clear them out. Was alot of fun.
UO Scripting wise I haven't done much. I'm starting in LUA and have allready written a simple script to toss blackrock pieces into the trash. Its the beginning of a mining script I hope to write.
Below is my script as it stands right now. It has to be fired off manually but it works without any problems that I've found so far. But in practice I find the person writing the code a poor checker so if anyone finds anything that needs fixing please speak up. I borrowed some of the code from the easyUO tutorials but have a firm grasp of what they are doing.
-----------------------------
-- Defined Functions (subs)
-----------------------------
function TargetContainer(sMessage)
UO.LTargetKind = 1 -- object
UO.ExMsg(UO.CharID , sMessage) -- Message above character
UO.TargCurs = true -- make a target cursor
while UO.TargCurs == true do wait(10) end -- wait until something is clicked (ie notarget cursor)
--;UO.LObjectID = UO.LTargetID -- set last object to the object clicked
--;UO.Macro(17,0) -- openbag ( invoke macro use last object which hopefully is a bag inwhich case opens bag )
return UO.LTargetID -- set the return value .. the bagid clicked
end
function TargetItem(sMessage)
UO.LTargetKind = 1
UO.ExMsg(UO.CharID , sMessage)
UO.TargCurs = true
while UO.TargCurs == true do wait(10) end
return UO.LTargetID
end
function FindItem(sName)
local cnt = UO.ScanItems(false) --;Calls the ScanItems command and sets the return value to the local variable cnt
i=0
while i ~= cnt do --; While i does not equal the cnt returned, loop.
local ID,Type,Kind,ContID,X,Y,Stack,Rep,Col = UO.GetItem(i) --;Set all these vars to the scanned item under i, starting at 1 and ending at cnt
local Name,Info = UO.Property(ID) --; Same thing as the last line, setting 2 variables with the return values of property, using ID defined in the line above.
if Name == sName then
print(Name)
return ID
end
i = i+1 --; Increment var to look at the next item, return to top until expression evaluates to false.
end --; Always end (case sensitive) your while/for/if's!! Will cause headaches if you do not remember!
end
function TrashItem(sName)
local cnt = UO.ScanItems(false)
i=0
while i~=cnt do
local ID = UO.GetItem(i)
local Name = UO.Property(ID)
if Name == sName then
UO.Drag(ID)
wait(nWait)
UO.DropC(nTrash)
wait(nWait/2)
end
i = i+1
end
end
-----------------------------
-- Script Starts Below
-----------------------------
nTrash = TargetContainer('Please Target Your Trashcan')
nWait = 600
TrashItem('A Small Piece Of Blackrock')
print('Done!')
UO.ExMsg(UO.CharID , 'Done !')
-
Hello and Welcome to Scriptuo. In the Openuo Section you should find more examples written by me and other Users. Its always a good source to check it out.
Coding can be much fun, as long as it doesnt end in hard work for casual scripters:)
Enjoy..
Crome
-
WELCOME!
-
Welcome!! You are the first person Ive welcomed. I joined the forum a week or 2 ago! :D
-
Welcome to he site
-
welcome to the community!