ScriptUO
Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: Coragin on October 30, 2009, 02:24:19 AM
-
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?
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
-
if %elemental_Damage_100% in #property && Blabla in #property && blingbling in #property
&& = AND
-
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:
if %elemental_Damage_100% in #property
MINE:
Your SUB Store would handle any Item with
the string
"Elemantal Damage 100" in it's property.
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
-
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....
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.
-
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
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
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 ...
if Damage_100 in #property
-
EN my savior!!!
-
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. :)
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
-
I think you might need an equality symbol of some sort in that "if findcnt" statement.
-
good except the missing equal sign as pointed out above ... and a missing close bracket..... plus id make one small change for flow ..
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
-
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.
-
your welcome.. and the only way to learn is to do... :)
looks like an interesting script your working on
-
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.
-
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.
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
-
Well if I make the storage pack the one in my backpack it will work. Weird, oh well at least its working.
-
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
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