ScriptUO
Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: Grandewd on October 12, 2013, 08:43:40 PM
-
Ok, I'm making Axes on my max'd out Blacksmith for my Lumberjack. Since weapons seem to die at the speed of light here on Siege, I'm going to supply him with only the longest lasting axes...
So, in the process of making a script to trash axes that aren't of a certain durability - I need to look at the properties of each one and keep or trash it based on whether or not it's durability is more than 65.
I've pondered this for the best part of an hour now, and can't come up with a way to do that.... I mean, I know I don't have to tell it about each possibility - as in -
if 65 in property || if 66 in property || if 67 in property - blah blah blah
Right?
I know there's a way to say: "If the Durability line shows anything less than 65, then do this..." without having to explain every single instance of a value beyond 65....
I'm working hard to not let this go past being annoyed.... HELP!
***Edit*** As I re-read my post to make sure it said what I wanted it to, I got to thinking about why it's possible to enjoy a thing sufficiently to overcome the seemingly endless state of frustration that scripting holds for me.... I think it's just the mental clarity that problem solving seems to provide, most especially when a problem is solved (and even when I'm not the one to solve it). For me it comes down to a simple choice: Do I give up and say to hell with it, or do I ask people that are more advanced than I am - for help filling in what's missing in my thought process... And when one of you manages to explain it to me so that I actually understand, that makes my brain feel just really nice....
So here I am, just sayin...........
-
Just a question - why not use hatchets?
and it is not durability but uses,
-
Gosub Property #Findid Durability
if #Result >= 65
Grabby Grabby
Sub Property
NameSpace Push
Namespace Local Mwinc_Property
set !Item %1
set !Property %2
For !Attempt 1 10
{
Event Property !Item
if Stone in #property
Break
wait 5
}
Str Count #property !Property
if #Strres > 0
{
set !Cnt #Strres
for !Holder 1 !Cnt
{
set !Value2 0
Str Len !Property
set !Length #Strres
Str Pos #property !Property !Holder
set !Start #Strres + !Length
for !Number 1 4
{
Str Mid #Property !Start !Number
if #Strres > 0
set !Value2 #Strres
}
set !Value !Value + !Value2
}
}
Else
set !Value 0
set #Result !Value
Namespace Clear
Namespace pop
Return #Result
-
take a look on how i do it here
http://www.scriptuo.com/index.php?topic=8886.msg77037#msg77037
-
Just a question - why not use hatchets?
and it is not durability but uses,
Wow, 3 different responses from 3 different people in less than 3 hours.... That in itself makes me quite freekin' giddy... :)
Ok, Mr. gimlet.... Why should I switch to hatchets? (Oh, and if it's only to save a few stinkin' ingots, then forget it)...
And regarding the relationship between durability and uses, one can only assume that higher durability = better item, hence: better item = more uses....
Is this an incorrect assumption? If so, then who was the moron who wrote that into the code?
::)
-
take a look on how i do it here
http://www.scriptuo.com/index.php?topic=8886.msg77037#msg77037
Omg - you've got a collection of snippets! I think I've died and gone to where ever...
Thank you for that...
-
Gosub Property #Findid Durability
if #Result >= 65
Grabby Grabby
Sub Property
NameSpace Push
Namespace Local Mwinc_Property
set !Item %1
set !Property %2
For !Attempt 1 10
{
Event Property !Item
if Stone in #property
Break
wait 5
}
Str Count #property !Property
if #Strres > 0
{
set !Cnt #Strres
for !Holder 1 !Cnt
{
set !Value2 0
Str Len !Property
set !Length #Strres
Str Pos #property !Property !Holder
set !Start #Strres + !Length
for !Number 1 4
{
Str Mid #Property !Start !Number
if #Strres > 0
set !Value2 #Strres
}
set !Value !Value + !Value2
}
}
Else
set !Value 0
set #Result !Value
Namespace Clear
Namespace pop
Return #Result
And last but not least, Mr. manwinc... If I'm not mistaken, you've been kind enough to come to my rescue here on more than one occasion...
And once again, force me to come to terms with namespace.... Namespace is one of the 2 or 3 final areas for me to master.... I will use it as a personal goal to finally - completely understand all the push/pull/pop'ing magic of namespace...
Thanks very much for taking the time to write that (or did you just quickly pull it up out of your sub directory)... Either way, I appreciate it for sure...
Peace bro... ;)
-
@freddy....
I see you're a Kobe fan - me too.... Ya' think he's got any left?
-
@freddy....
I see you're a Kobe fan - me too.... Ya' think he's got any left?
Kobe isn't going anywhere til get gets number 6 :D
-
Or in Stealth with pascal you could use this Sub.
function GetUseCount(ItemID:Cardinal):Integer;
var
a : TClilocRec;
b : TClilocItemRec;
i : Integer;
begin
a:=GetToolTipRec(ItemID);
if( a.Count > 0 ) then
begin
for i:=0 to a.Count-1 do
begin
b:=a.Items[i];
if( b.ClilocID = 1060584 ) then
begin
Result:=StrToInt(b.Params[0]);
Exit;
end;
end;
end;
Result:=0;
end;
And pass FindItem like so.
//This is a test with Fletching tools so you would change $1022 to $0F43, which is the Type for Hatchet.
if( (FindTypeEx($1022,$FFFF,Backpack,False)>0) ) then
begin
ClientPrint(IntToStr(GetUseCount(FindItem)));
end;
And to compare... As simple as :
if( (FindTypeEx($0F43,$FFFF,Backpack,False)>0) ) then
begin
if( GetUseCount(FindItem)>60 ) then
begin
//Do whatever here.
end
end;
-
@freddy....
I see you're a Kobe fan - me too.... Ya' think he's got any left?
Kobe isn't going anywhere til get gets number 6 :D
Not without some sort of miracle... He and Nash are just aging, and Gasol ain't showed nothing lately...
I'm afraid the time has come and gone... sadly
-
Hey dxrom... Thx for the pascal/Stealth lesson... Are you actively playing still and using Stealth now?
-
Hey dxrom... Thx for the pascal/Stealth lesson... Are you actively playing still and using Stealth now?
Yep!
I would like to point out how much easier stealth example was over easyuo :>
-
Stealth is an alternative "client", right? I assume that if I use the Stealth client then I can NOT use oEUO or EUO - is that correct?
-
Stealth is an alternative "client", right? I assume that if I use the Stealth client then I can NOT use oEUO or EUO - is that correct?
You can use EUO/oEUO just fine. Stealth emulates and is capable of drawing out a GUI version of the client. You can also utilize Razor with stealth.
Due to the limitations of EUO/oEUO however you will be required to always have the client open in order for EUO/oEUO to have something to attach to and send commands to.
You should check out this video for a better basic understanding of Stealth, Orich did a very good job in making the video :>
-
Anyone got assistuo working with Stealth?