ScriptUO
Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: Neo on August 13, 2011, 03:24:08 PM
-
Hey guys, I'm working on releasing the new version of my crafter, and I just came across this issue. If i set an option to save Elemental Slayer, it's saving anything with elemental slayer in the property, even though I set a check for other elementals notin #property... Am I doing sth wrong? I really can't find a way out of this... If anyone can help, I'd greatly appreciate it... Thank you!
if ( %prop . %checkindex = Elemental , #spc , Slayer && Elemental , #spc , Slayer in #property )
{
event property #findid
wait 5
if ( air notin #property && blood notin #property && earth notin #property && fire , #spc , elemental notin #property && poison , #spc , elemental notin #property && snow notin #property && water notin #property )
{
menu Font Color Black
menu Font BGColor Window
menu list add savedlist %prop . %checkindex
set %totalcnt %totalcnt + 1
menu delete EUOLabel11
menu Text EUOLabel11 280 204 Weapons Saved: %totalcnt
gosub keep %currentweapon
ignoreitem #findid
return
}
}
-
Post a little snippet of code. I'll bet I know what the problem is. Remember there are differences between #SPC and "_" from #PROPERTY and journal scans.
-
I've also tried like this:
if ( %prop . %checkindex = Elemental , #spc , Slayer && Elemental , #spc , Slayer in #property && Air notin #property && Blood notin #property && Earth notin #property && Fire , #spc , Elemental notin #property && Poison , #spc , Elemental notin #property && Snow notin #property && Water notin #property )
{
menu Font BGColor Window
menu list add savedlist %prop . %checkindex
menu Font Color Black
menu delete EUOLabel11
menu Text EUOLabel11 280 204 Weapons Saved: %totalcnt
set %totalcnt %totalcnt + 1
gosub keep %currentweapon
ignoreitem #findid
return
}
and this:
if ( %prop . %checkindex = Elemental , #spc , Slayer && $Elemental , #spc , Slayer in #property)
{
menu Font BGColor Window
menu list add savedlist %prop . %checkindex
menu Font Color Black
menu delete EUOLabel11
menu Text EUOLabel11 280 204 Weapons Saved: %totalcnt
set %totalcnt %totalcnt + 1
gosub keep %currentweapon
ignoreitem #findid
return
}
using $elemental, thinking about the line break using $ in the property...
None of these is working still...
Anyone have any ideas?
-
What I meant is that I posted the wrong code here... All these codes are the ones I tried, and none of these are working... If anyone can see where I'm doing things wrong, please help me...
Cheers!
-
Hey guys, I'm working on releasing the new version of my crafter, and I just came across this issue. If i set an option to save Elemental Slayer, it's saving anything with elemental slayer in the property, even though I set a check for other elementals notin #property... Am I doing sth wrong? I really can't find a way out of this... If anyone can help, I'd greatly appreciate it... Thank you!
if ( %prop . %checkindex = Elemental , #spc , Slayer && Elemental , #spc , Slayer in #property )
{
event property #findid
wait 5
if ( air notin #property && blood notin #property && earth notin #property && fire , #spc , elemental notin #property && poison , #spc , elemental notin #property && snow notin #property && water notin #property
{
menu Font Color Black
menu Font BGColor Window
menu list add savedlist %prop . %checkindex
set %totalcnt %totalcnt + 1
menu delete EUOLabel11
menu Text EUOLabel11 280 204 Weapons Saved: %totalcnt
gosub keep %currentweapon
ignoreitem #findid
return
}
}
if ( air notin #property && blood notin #property && earth notin #property && fire , #spc , elemental notin #property && && poison , #spc , elemental notin #property && snow notin #property && water notin #property
You did not close your bracket after water notin #property
JaF
-
Hi JaF, thx for the reply!
I copied it wrong here, I do have the bracket in the code, and it's still not working!
Any other ideas?
Thank you for helping me out!
Cheers!
Tm was here to help too, but I guess he misunderstood my post, and thought I had already solved it...
Thanks for helping me out guys!
-
oh, also...
your code is evaluating like this:
If air notin #property and blood notin #property and earth notin #property.... etc
So what it is doing is checking the #property and saying ok I have an elemental slayer book... BUT it does not have AIR and Blood and Earth and etc... all lumped into the property. In other words, it is not an AIR Ele, Blood Ele, Earth Ele combined slayer.
Try the OR statment instead....
if ( air notin #property || blood notin #property || earth notin #property || fire , #spc , elemental notin #property || poison , #spc , elemental notin #property || snow notin #property || water notin #property )
JaF
-
But if I use OR, if one of the elemental types isn't in the property, it will already think it's ok to save, won't it?
Thx JaF
-
Tried with or, it isn't working either...
:(
-
Ok, I found a workaround for this... But still, using notin #property is not working for me! Tried every way using notin property, with no success...
My workaround was this:
if ( %prop . %checkindex = Elemental , #spc , Slayer && Elemental , #spc , Slayer in #property )
{
if ( air in #property || blood in #property || earth in #property || fire , #spc , elemental in #property || poison , #spc , elemental in #property || snow in #property || water in #property )
{
continue
}
else
{
menu Font Color Black
menu Font BGColor Window
menu list add savedlist %prop . %checkindex
set %totalcnt %totalcnt + 1
menu delete EUOLabel11
menu Text EUOLabel11 280 204 Weapons Saved: %totalcnt
gosub keep %currentweapon
ignoreitem #findid
return
}
}
I put the continue there to jump outta there in case any other elemental was found in the property!
-
But if I use OR, if one of the elemental types isn't in the property, it will already think it's ok to save, won't it?
Thx JaF
Looking back over my own scripts... I think I need to correct myself. Looks like && is correct after all.
Try it without it being inside ( ) brackets
Example:
if elemental in #property && blood notin #property && air notin #property && earth notin #property
{
do whatever
}
JaF
-
But if I use OR, if one of the elemental types isn't in the property, it will already think it's ok to save, won't it?
Thx JaF
Looking back over my own scripts... I think I need to correct myself. Looks like && is correct after all.
Try it without it being inside ( ) brackets
Example:
if elemental in #property && blood notin #property && air notin #property && earth notin #property
{
do whatever
}
JaF
Yes, I tried without brackets too. No luck!
I have no idea why this is happening... I'm not using "notin #property" again, until I can figure this one out!
Cheers JaF!
-
Logical Operators
%a && %b
And
If both values evaluate as true, the expression is true.
%a || %b
Or
If either one of the values evaluates as true, the expression is true.
! %a
Not
Gives the logical inverse of the evaluation. True will exaluate to false, and false to true.
-
Unfortunately, EUO is down for us EA Mythic players so I can not test any code at the moment. When it gets fixed I will give it a shot. Sorry I couldnt help more.
JaF
-
I really appreciate the help JaF!
Cheers!
-
You could use
if earth , #spc , elemental in #property|| fire , #spc , elemental in #property
{
}
else
{
if elemental in #property
{
}
}
or
if earth notin #property && fire notin #property && elemental in #property
{}
should work!
Crome
-
You could use
if earth , #spc , elemental in #property|| fire , #spc , elemental in #property
{
}
else
{
if elemental in #property
{
}
}
or
if earth notin #property && fire notin #property && elemental in #property
{}
should work!
Crome
Thanks for posting crome... I tried the second way you posted, and it didn't work... The first way is similar to the workaround I used, and it doesn't use notin #property...
So, we can use workarounds apparentely, but I've found no working way using the notin #property thing...
Thanks for taking the time to help me...
neo
-
I find that sometimes its better to do:
if ( air notin #property) && ( blood notin #property ) && etc.....
That way, if one of them is screwed up, it will likely evaluate to false and then the whole if will evaluate to false...just a thought!
-
I find that sometimes its better to do:
if ( air notin #property) && ( blood notin #property ) && etc.....
That way, if one of them is screwed up, it will likely evaluate to false and then the whole if will evaluate to false...just a thought!
Nice, never tried it like this... Will give this a go later!
Thank you maddog!
neo