Author Topic: How do I check item property 100% x damage?  (Read 8195 times)

0 Members and 1 Guest are viewing this topic.

Offline CoraginTopic starter

  • Wacko in Pajama's
  • Elite
  • *
  • *
  • Posts: 1641
  • Activity:
    0%
  • Reputation Power: 23
  • Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...
  • Gender: Male
  • It Is What It Is.
  • Respect: +117
  • Referrals: 1
    • View Profile
How do I check item property 100% x damage?
« on: October 30, 2009, 02:24:19 AM »
0
Im writing a script to burn runics for 100% elemental damage weapons and unravel (and possibly enhance before unravel) what is left.  I know how to check a property with one word, but what about two or three words?

Is this correct?

Code: [Select]
set %elemental Poison_Energy_Fire_Cold

sub CheckWeapon
         finditem %weapon C_ , #backpackid
         if #findkind <> -1
            {
            event property #findid
            if %elemental_Damage_100% in #property
               {
               set %EleDmg #true
               wait 5
               Gosub Store
               Return
               }
            Gosub Unravel
            }
return
Coragin

My Facebook
And now I'm better at doing what ever it is Wolverine does!

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +786
  • Referrals: 1
    • View Profile
Re: How do I check item property 100% x damage?
« Reply #1 on: November 01, 2009, 07:24:34 AM »
0
Code: [Select]
if %elemental_Damage_100% in #property &&  Blabla in #property && blingbling in #property
&& = AND
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline rana70

  • Elite
  • *
  • *
  • Posts: 294
  • Activity:
    0%
  • Reputation Power: 5
  • rana70 has no influence.
  • Gender: Male
  • Respect: +75
  • Referrals: 2
    • View Profile
    • MyScripts
Re: How do I check item property 100% x damage?
« Reply #2 on: November 01, 2009, 07:40:33 AM »
0
Hi,

as far as I understand you ....
you would like to act when ever the Item has
Elemental Damage 100%

your line should work basicly, there is just a little
error .. right now you check for a var and not for the actual words
 
YOURS:
Code: [Select]
if %elemental_Damage_100% in #property

MINE:
Your SUB Store would handle any Item with
the string
"Elemantal Damage 100" in it's property.

Code: [Select]
if Elemental_Damage_100 in #property


and EN is right .. you can combine this search with
- && for AND
- || for OR
- you can use IN or NOTIN
like every other if .. you use in combination with vars

cu
« Last Edit: November 01, 2009, 07:44:03 AM by rana70 »

Offline CoraginTopic starter

  • Wacko in Pajama's
  • Elite
  • *
  • *
  • Posts: 1641
  • Activity:
    0%
  • Reputation Power: 23
  • Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...
  • Gender: Male
  • It Is What It Is.
  • Respect: +117
  • Referrals: 1
    • View Profile
Re: How do I check item property 100% x damage?
« Reply #3 on: November 02, 2009, 08:16:42 PM »
0
Okay I understand and or.

Was my "set" correct?

With the underscore between Poison, Fire Ect?

Also, just for 100 dmg weapons, will the original code work?  Just as EN typed it....minus....

Code: [Select]
if %elemental_Damage_100% in #property
Will that pick up 100 fire, 100 energy ect?  Then I do the rest of the if configuration?

Sorry to res this, but I have been away a few days and forgot about it until now lol.
Coragin

My Facebook
And now I'm better at doing what ever it is Wolverine does!

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +786
  • Referrals: 1
    • View Profile
Re: How do I check item property 100% x damage?
« Reply #4 on: November 03, 2009, 05:36:15 AM »
0
Code: [Select]
if elemental_Damage_100 in #property &&  Blabla in #property && blingbling in #property
&& = AND

Above will pickup 100% elemental damage and Blabla and blingbling ONLY   will not pick up 100% fire or other resists .. if you want those you need to specifically list those

Code: [Select]
if elemental_Damage_100 in #property &&
            fire_Damage_100 in #property  &&
            Poison_Damage_100 in #property

Above requires all 3 resists to be 100% .. maybe you just need one to be 100% then

Code: [Select]
if elemental_Damage_100 in #property ||
            fire_Damage_100 in #property         ||
            Poison_Damage_100 in #property

.. or use a more generic term such as below .. but that might pickup undesirable results i dont know ...

Code: [Select]
if Damage_100 in #property
« Last Edit: November 03, 2009, 05:40:38 AM by Endless Night »
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline CoraginTopic starter

  • Wacko in Pajama's
  • Elite
  • *
  • *
  • Posts: 1641
  • Activity:
    0%
  • Reputation Power: 23
  • Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...
  • Gender: Male
  • It Is What It Is.
  • Respect: +117
  • Referrals: 1
    • View Profile
Re: How do I check item property 100% x damage?
« Reply #5 on: November 03, 2009, 05:11:21 PM »
0
EN my savior!!!
Coragin

My Facebook
And now I'm better at doing what ever it is Wolverine does!

Offline CoraginTopic starter

  • Wacko in Pajama's
  • Elite
  • *
  • *
  • Posts: 1641
  • Activity:
    0%
  • Reputation Power: 23
  • Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...
  • Gender: Male
  • It Is What It Is.
  • Respect: +117
  • Referrals: 1
    • View Profile
Re: How do I check item property 100% x damage?
« Reply #6 on: November 03, 2009, 05:37:57 PM »
0
So this is correct right?  I only ask instead of testing as it could take hundreads of weapons and or runics to get even one, thats a long time to sit there and wait and watch.  :)

Code: [Select]
sub CheckWeapon1
         finditem %MadeWeapon C_ , #backpackid
         if #findcnt 1
            {
            event property #findid
            if Cold_Damage_100 in #property ||
            Fire_Damage_100 in #property         ||
            Poison_Damage_100 in #property     ||
            Energy_Damage_100 in #property
               {
               gosub StoreWeapon
               Return
               }
            Gosub Unravel
Return
Coragin

My Facebook
And now I'm better at doing what ever it is Wolverine does!

Offline cgeorgemo

  • Hero Member
  • *
  • Posts: 586
  • Activity:
    0%
  • Reputation Power: 5
  • cgeorgemo has no influence.
  • Gender: Male
  • I'm Brian...cgeorgemo is Curious George Missouri
  • Respect: +36
  • Referrals: 1
    • View Profile
Re: How do I check item property 100% x damage?
« Reply #7 on: November 03, 2009, 05:41:11 PM »
0
I think you might need an equality symbol of some sort in that "if findcnt" statement.
Sarcasm is your body's natural defense against stupidity.

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +786
  • Referrals: 1
    • View Profile
Re: How do I check item property 100% x damage?
« Reply #8 on: November 03, 2009, 07:20:53 PM »
0
good except the missing equal sign as pointed out above ... and a missing close bracket..... plus id make one small change for flow ..

Code: [Select]
sub CheckWeapon1
         finditem %MadeWeapon C_ , #backpackid
         if #findcnt >= 1
            {
            event property #findid
            if Cold_Damage_100 in #property ||
              Fire_Damage_100 in #property         ||
              Poison_Damage_100 in #property     ||
              Energy_Damage_100 in #property                
                 gosub StoreWeapon
             }
         if #findcnt = 0
            Gosub Unravel
Return
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline CoraginTopic starter

  • Wacko in Pajama's
  • Elite
  • *
  • *
  • Posts: 1641
  • Activity:
    0%
  • Reputation Power: 23
  • Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...
  • Gender: Male
  • It Is What It Is.
  • Respect: +117
  • Referrals: 1
    • View Profile
Re: How do I check item property 100% x damage?
« Reply #9 on: November 03, 2009, 07:25:57 PM »
0
Okay gonna try that, thanks EN, this is the only problem I am having and its hard lol.  But damn I have learned a lot in a few short months.
Coragin

My Facebook
And now I'm better at doing what ever it is Wolverine does!

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +786
  • Referrals: 1
    • View Profile
Re: How do I check item property 100% x damage?
« Reply #10 on: November 03, 2009, 07:27:07 PM »
0
your welcome.. and the only way to learn is to do... :)

looks like an interesting script your working on
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline CoraginTopic starter

  • Wacko in Pajama's
  • Elite
  • *
  • *
  • Posts: 1641
  • Activity:
    0%
  • Reputation Power: 23
  • Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...
  • Gender: Male
  • It Is What It Is.
  • Respect: +117
  • Referrals: 1
    • View Profile
Re: How do I check item property 100% x damage?
« Reply #11 on: November 03, 2009, 07:55:58 PM »
0
All the scripts I am building come from other scripts I used, but most of them are based around imbued armor and weapons to build the best suits and stuff right now.  With a lot of subs I find in other scripts that I know what they are doing so I copy, paste, change, mutilate code and try like hell  to get it right.  Someday I will write my own from scratch.
Coragin

My Facebook
And now I'm better at doing what ever it is Wolverine does!

Offline CoraginTopic starter

  • Wacko in Pajama's
  • Elite
  • *
  • *
  • Posts: 1641
  • Activity:
    0%
  • Reputation Power: 23
  • Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...
  • Gender: Male
  • It Is What It Is.
  • Respect: +117
  • Referrals: 1
    • View Profile
Re: How do I check item property 100% x damage?
« Reply #12 on: November 03, 2009, 08:12:01 PM »
0
Okay its still not working.  Can someone help.  It makes the weapon and stores it, dont unravel, and stores ALL weapons, no matter of the property.  And when the runic runs out of uses it stops.  This is a tough one, if it was a one word property I know I could get it right.  I dont know what Im doing wrong cause you basicly did the sub for me EN.

EDIT: It is trying to unravel but it is moving it to storagepack before.  So there is my problem.


Code: [Select]
Event Macro 8 7
Display Ok Select the Resource Container.
  set #targcurs 1
      while #targcurs = 1
         wait 1
         set %ResourceBag #ltargetID
      set #lobjectID #ltargetID
      set #nextcposx 200
      set #nextcposy 0
      event macro 17
      wait 10
Display Ok Select your storage Bag in Resource Container.
  set #targcurs 1
      while #targcurs = 1
         wait 1
      set %StorageBag #ltargetID
      set #lobjectID #ltargetID
      set #nextcposx 400
      set #nextcposy 0
      event macro 17
      wait 20


set %residue TKR_WKR
set %weapon KDP
set %Wood TLK
set %elemental Poison_Fire_Cold_Energy
set %percent 100%
set %runic ZFG_
set %slayer Elemental_Reptile_Undead_Arachnid_Demon_Slayer
set #nextcposx 0
set #nextcposy 0
set %imain 520_250           ; Imbuing Main menu size
set %isec 520_440            ; Imbuing secondary menus for properties and value
set %cwin 530_507            ; Crafting window size
set %gumpwait 5 ; Increase number to slow down clicks on menus.  20 = 1 second.

MainLoop:
Gosub GetTools
Gosub MakeWeapon
Gosub CheckWeapon1
Goto MainLoop

sub GetTools
    finditem %runic C_ , #backpackid
      if #findcnt < 1
         {
         finditem %runic C_ , %ResourceBag
         if #findkind = -1
            {
            display You are out of runics.
            halt
            }
         exevent drag #findid 1
         wait 10
         exevent dropc #backpackid
         wait 20
         }
    finditem %Wood C_ , #backpackid
         if #findstack < 200
         {
         set %quantityinpack 200 - #findstack
         finditem %Wood C_ , %ResourceBag
         if #findstack < %quantityinpack
            {
            display You need more wood.
            halt
            }
         else
            {
            exevent drag #findid %quantityinpack
            wait 10
            exevent dropc #backpackid
            wait 20
            }
         }
         Return

Sub MakeWeapon
    finditem %Weapon C_ , #BackPackid
    If #findcnt = 1
       {
       set %MadeWeapon #findid
       gosub CheckWeapon1
       Return
       }
    finditem %runic C_ , #BackPackid
    set #lobjectid #findid
    event macro 17
    gosub waitforgump %cwin
    Click 335 500 f    ;Make Last
    gosub waitforgump %cwin
    Click 77 505 f    ;exit
    wait 20
    finditem %Weapon C_ , #BackPackID
    set %MadeWeapon #findid
Return

sub CheckWeapon1
         finditem %MadeWeapon C_ , #backpackid
         if #findcnt >= 1
            {
            event property #findid
            if Cold_Damage_100 in #property ||
              Fire_Damage_100 in #property         ||
              Poison_Damage_100 in #property     ||
              Energy_Damage_100 in #property
                 gosub StoreWeapon
             }
         if #findcnt = 0
            Gosub Unravel
Return

Sub StoreWeapon
    finditem %Weapon C_ , #backpackid
    exevent drag #findid #findstack
    wait 10
    exevent dropc %StorageBag
    wait 20
    finditem %MadeWeapon C_ , #backpackid
    exevent drag #findid #findstack
    wait 10
    exevent dropc %StorageBag
    wait 20
Return

Sub StoreResidue
    finditem %Residue C_ , #backpackid
    if #findcnt < 1
              return
    exevent drag #findid #findstack
    wait 10
    exevent dropc %ResourceBag
    wait 20
Return

Sub Unravel
Repeat
    finditem %MadeWeapon C_ , #BackPackid
    If #findcnt = -1
       {
       Return
       }
    Event Macro 13 56
    gosub waitforgump %imain
          if ! #result
          {
          display ok Problems opening the imbue menu.  Dble Click fletcher tool and click play
          pause
          }
    Click 228 248 f
    wait 30
    set #ltargetID %MadeWeapon
    event macro 22 0
    ;gosub waitforgump %imain
          if ! #result
          {
          display ok Problems with imbue unravel menu.  Dble Click fletcher tool and click play
          pause
          }
    Click 50 250 f
    wait 30
    gosub StoreResidue
Return

;================== Wait for gump ======================

sub waitforgump
set %timeout #scnt + 30
while #contsize <> %1
      {
      wait 1
      if #scnt > %timeout
         {
          return #false
         }
      }
wait %gumpwait
return #true

sub CheckWeapon1
         finditem %MadeWeapon C_ , #backpackid
         if #findcnt 1
            {
            event property #findid
            if %elemental in #Property && Damage in #property && %percent in #property
            ;if Slayer in #property
            ;if Physical_Damage_100% in #property || %slayer in #property || Energy_Damage_100% in #property || Fire_Damage_100% in #property || Cold_Damage_100% in #property || Slayer in #property
               {
               gosub StoreWeapon
               Return
               }
            Gosub Unravel
Return
« Last Edit: November 03, 2009, 08:15:14 PM by Coragin »
Coragin

My Facebook
And now I'm better at doing what ever it is Wolverine does!

Offline CoraginTopic starter

  • Wacko in Pajama's
  • Elite
  • *
  • *
  • Posts: 1641
  • Activity:
    0%
  • Reputation Power: 23
  • Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...
  • Gender: Male
  • It Is What It Is.
  • Respect: +117
  • Referrals: 1
    • View Profile
Re: How do I check item property 100% x damage?
« Reply #13 on: November 03, 2009, 08:25:35 PM »
0
Well if I make the storage pack the one in my backpack it will work.  Weird, oh well at least its working.
Coragin

My Facebook
And now I'm better at doing what ever it is Wolverine does!

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +786
  • Referrals: 1
    • View Profile
Re: How do I check item property 100% x damage?
« Reply #14 on: November 03, 2009, 08:29:04 PM »
0
my bad you have to be carefull with finditem vars.. heres a clasic the subs the sub calls do finditems thus resenting the value of findcnt

so here it is revised

Code: [Select]
sub CheckWeapon1
         finditem %MadeWeapon C_ , #backpackid
         set !CheckWeaponFindcnt #findcnt
         if !CheckWeaponFindcnt >= 1
            {
            event property #findid
            if Cold_Damage_100 in #property ||
              Fire_Damage_100 in #property         ||
              Poison_Damage_100 in #property     ||
              Energy_Damage_100 in #property
                 gosub StoreWeapon
             }
         if !CheckWeaponFindcnt = 0
            Gosub Unravel
Return
Return
« Last Edit: November 03, 2009, 08:30:59 PM by Endless Night »
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Tags: