Author Topic: This should be simple, but apparently not for me....  (Read 6788 times)

0 Members and 1 Guest are viewing this topic.

Offline GrandewdTopic starter

  • Full Member
  • ***
  • Posts: 239
  • Activity:
    0%
  • Reputation Power: 3
  • Grandewd has no influence.
  • Respect: +44
  • Referrals: 0
    • View Profile
This should be simple, but apparently not for me....
« on: October 12, 2013, 08:43:40 PM »
0
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 -

Code: [Select]
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...........
« Last Edit: October 12, 2013, 09:09:57 PM by Grandewd »

Offline gimlet

  • Very Super Secret
  • Global Moderator
  • *
  • *
  • Posts: 6217
  • Activity:
    1.4%
  • Reputation Power: 72
  • gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!
  • Gender: Male
  • Respect: +624
  • Referrals: 3
    • View Profile
Re: This should be simple, but apparently not for me....
« Reply #1 on: October 12, 2013, 09:16:41 PM »
0
Just a question - why not use hatchets?
and it is not durability but uses,
« Last Edit: October 12, 2013, 09:20:31 PM by gimlet »

Offline manwinc

  • Elite
  • *
  • *
  • Posts: 2556
  • Activity:
    0%
  • Reputation Power: 32
  • manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!
  • Gender: Male
  • "The Devs Hard at Work"
  • Respect: +237
  • Referrals: 1
    • View Profile
Re: This should be simple, but apparently not for me....
« Reply #2 on: October 12, 2013, 09:44:18 PM »
0

Gosub Property #Findid Durability
if #Result >= 65
Grabby Grabby

Code: [Select]
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
Monkeys and Typewriters!

" Oh I know, We'll make a Boss Encounter that requires 3 keys per player to enter, Then we'll make it not a closed instance so you never know if you are going to pop into a fresh room or a boss that has 1% Health left with 20 dudes smashing its face in, wasting your time and effort"

Offline freddy

  • Sr. Member
  • *
  • Posts: 271
  • Activity:
    0%
  • Reputation Power: 4
  • freddy has no influence.
  • Gender: Male
  • Respect: +107
  • Referrals: 1
    • View Profile
Re: This should be simple, but apparently not for me....
« Reply #3 on: October 12, 2013, 10:01:31 PM »
0

Offline GrandewdTopic starter

  • Full Member
  • ***
  • Posts: 239
  • Activity:
    0%
  • Reputation Power: 3
  • Grandewd has no influence.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: This should be simple, but apparently not for me....
« Reply #4 on: October 12, 2013, 11:12:54 PM »
0
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?
 ::)

Offline GrandewdTopic starter

  • Full Member
  • ***
  • Posts: 239
  • Activity:
    0%
  • Reputation Power: 3
  • Grandewd has no influence.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: This should be simple, but apparently not for me....
« Reply #5 on: October 12, 2013, 11:18:43 PM »
0
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...

Offline GrandewdTopic starter

  • Full Member
  • ***
  • Posts: 239
  • Activity:
    0%
  • Reputation Power: 3
  • Grandewd has no influence.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: This should be simple, but apparently not for me....
« Reply #6 on: October 12, 2013, 11:24:00 PM »
0

Gosub Property #Findid Durability
if #Result >= 65
Grabby Grabby

Code: [Select]
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...  ;)
« Last Edit: October 12, 2013, 11:28:10 PM by Grandewd »

Offline GrandewdTopic starter

  • Full Member
  • ***
  • Posts: 239
  • Activity:
    0%
  • Reputation Power: 3
  • Grandewd has no influence.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: This should be simple, but apparently not for me....
« Reply #7 on: October 12, 2013, 11:54:18 PM »
0
@freddy....

I see you're a Kobe fan - me too....  Ya' think he's got any left?

Offline freddy

  • Sr. Member
  • *
  • Posts: 271
  • Activity:
    0%
  • Reputation Power: 4
  • freddy has no influence.
  • Gender: Male
  • Respect: +107
  • Referrals: 1
    • View Profile
Re: This should be simple, but apparently not for me....
« Reply #8 on: October 13, 2013, 12:57:50 AM »
0
@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

Offline dxrom

  • Master of the milestones!
  • Elite
  • *
  • *
  • Posts: 1080
  • Activity:
    0%
  • Reputation Power: 15
  • dxrom is working their way up.dxrom is working their way up.dxrom is working their way up.
  • KEYBOARD COWBOY, GREAT SAMURAI OF THE INTERNET.
  • Respect: +268
  • Referrals: 1
    • View Profile
Re: This should be simple, but apparently not for me....
« Reply #9 on: October 13, 2013, 05:35:51 AM »
0
Or in Stealth with pascal you could use this Sub.

Code: [Select]
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.

Code: [Select]
//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 :
Code: [Select]
if( (FindTypeEx($0F43,$FFFF,Backpack,False)>0) ) then
 begin
   if( GetUseCount(FindItem)>60 ) then
   begin
     //Do whatever here.
   end
 end;
« Last Edit: October 13, 2013, 06:10:30 AM by dxrom »



 ​_██​_
(ಠ​_ృ)
I do say, ol' Chap! Come play EVE Online! Why here is a 21 Day Free Trial!

Offline GrandewdTopic starter

  • Full Member
  • ***
  • Posts: 239
  • Activity:
    0%
  • Reputation Power: 3
  • Grandewd has no influence.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: This should be simple, but apparently not for me....
« Reply #10 on: October 14, 2013, 08:58:04 AM »
0
@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

Offline GrandewdTopic starter

  • Full Member
  • ***
  • Posts: 239
  • Activity:
    0%
  • Reputation Power: 3
  • Grandewd has no influence.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: This should be simple, but apparently not for me....
« Reply #11 on: October 14, 2013, 09:02:08 AM »
0
Hey dxrom... Thx for the pascal/Stealth lesson...  Are you actively playing still and using Stealth now?

Offline dxrom

  • Master of the milestones!
  • Elite
  • *
  • *
  • Posts: 1080
  • Activity:
    0%
  • Reputation Power: 15
  • dxrom is working their way up.dxrom is working their way up.dxrom is working their way up.
  • KEYBOARD COWBOY, GREAT SAMURAI OF THE INTERNET.
  • Respect: +268
  • Referrals: 1
    • View Profile
Re: This should be simple, but apparently not for me....
« Reply #12 on: October 14, 2013, 09:04:24 AM »
0
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 :>



 ​_██​_
(ಠ​_ృ)
I do say, ol' Chap! Come play EVE Online! Why here is a 21 Day Free Trial!

Offline GrandewdTopic starter

  • Full Member
  • ***
  • Posts: 239
  • Activity:
    0%
  • Reputation Power: 3
  • Grandewd has no influence.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: This should be simple, but apparently not for me....
« Reply #13 on: October 14, 2013, 10:07:37 AM »
0

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?

Offline dxrom

  • Master of the milestones!
  • Elite
  • *
  • *
  • Posts: 1080
  • Activity:
    0%
  • Reputation Power: 15
  • dxrom is working their way up.dxrom is working their way up.dxrom is working their way up.
  • KEYBOARD COWBOY, GREAT SAMURAI OF THE INTERNET.
  • Respect: +268
  • Referrals: 1
    • View Profile
Re: This should be simple, but apparently not for me....
« Reply #14 on: October 14, 2013, 10:18:32 AM »
0

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 :>




 ​_██​_
(ಠ​_ృ)
I do say, ol' Chap! Come play EVE Online! Why here is a 21 Day Free Trial!

Tags: