ScriptUO
Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: Crisis on December 27, 2013, 10:05:30 AM
-
1. How script a check to see if your character is hidden? Only thing that I could really find is doing a check for a hidden flag on EUO. I want to add a hide option on a craft script but this would be used at a bank and hiding is low.
event macro 13 21
wait 11000
if H in #charStatus
{
gosub startcraft
}
return
Will this continue to try and hide until character is hidden and then move onto the crafting sub? If not, what am I doing wrong? Is there a better way to do this?
2. Using this meditation sub, where would I put in a hide event so that the character hides when meditation is done?
sub CheckMana
menu delete scriptstatus
Menu Font BGColor Black
menu Font Color Lime
menu text scriptstatus 95 100 Checking Mana
set %_test ( 100 * #mana ) / #maxmana
if ( %_test < 35 ) || ( #mana < %mana )
{
gosub actionblock
menu delete scriptstatus
Menu Font BGColor Black
menu Font Color Lime
menu text scriptstatus 95 100 Meditating
event macro 13 46 ; meditate
set %_tlastskill #systime + 10100
while #mana < ( 95 * #maxmana / 100 )
{
gosub hardwait 1
if %_tlastskill < #systime
{
gosub actionblock
event macro 13 46 ; meditate
set %_tlastskill #systime + 10200
}
}
set %_diff #systime - %_tlastskill - 9000
if %_diff > 0
{
set %_diff ( %_diff / 50 ) + 1
gosub hardwait %_diff
}
}
return
-
1. How script a check to see if your character is hidden? Only thing that I could really find is doing a check for a hidden flag on EUO. I want to add a hide option on a craft script but this would be used at a bank and hiding is low.
event macro 13 21
wait 11000
if H in #charStatus
{
gosub startcraft
}
return
Will this continue to try and hide until character is hidden and then move onto the crafting sub? If not, what am I doing wrong? Is there a better way to do this?
I do this in a number of scripts, here is an example using the mainloop from my Cart trainer:
;Start Mainloop
repeat
gosub XIIxSkillCheck Cart %StartSkill
set %CurrentSkill #RESULT
gosub SetMap %CurrentSkill
set %CurrentMap #RESULT
gosub XIIxMaxWeight 0
set %ScrollAmount #RESULT - #WEIGHT
while %ToHide = yes && H notin #CHARSTATUS
{
event macro 13 21
wait 11s ;<------ you can skip this if you don't plan to use another skill afterward
}
gosub CartCraft
gosub TrashMap
if #menubutton = Pause
gosub XIIxPause
until #FALSE
; End Mainloop
In this particular example I set a veriable %ToHide in the setup portion but you should still get the point. The idea is to deal with hiding before moving on to the rest of the logic (in the setup subs I don't even give the user the option to try hiding if the skill is less than 20 unless they are human).
2. Using this meditation sub, where would I put in a hide event so that the character hides when meditation is done?
Don't do it in the sub, do it after you return from the sub.
X
-
1. How script a check to see if your character is hidden? Only thing that I could really find is doing a check for a hidden flag on EUO. I want to add a hide option on a craft script but this would be used at a bank and hiding is low.
event macro 13 21
wait 11000
if H in #charStatus
{
gosub startcraft
}
return
Will this continue to try and hide until character is hidden and then move onto the crafting sub? If not, what am I doing wrong? Is there a better way to do this?
I do this in a number of scripts, here is an example using the mainloop from my Cart trainer:
;Start Mainloop
repeat
gosub XIIxSkillCheck Cart %StartSkill
set %CurrentSkill #RESULT
gosub SetMap %CurrentSkill
set %CurrentMap #RESULT
gosub XIIxMaxWeight 0
set %ScrollAmount #RESULT - #WEIGHT
while %ToHide = yes && H notin #CHARSTATUS
{
event macro 13 21
wait 11s ;<------ you can skip this if you don't plan to use another skill afterward
}
gosub CartCraft
gosub TrashMap
if #menubutton = Pause
gosub XIIxPause
until #FALSE
; End Mainloop
In this particular example I set a veriable %ToHide in the setup portion but you should still get the point. The idea is to deal with hiding before moving on to the rest of the logic (in the setup subs I don't even give the user the option to try hiding if the skill is less than 20 unless they are human). Ok so the script will continue to try while h is not in the character status? What does the && do?
2. Using this meditation sub, where would I put in a hide event so that the character hides when meditation is done?
Don't do it in the sub, do it after you return from the sub. I tried doing it at the beginning of my crafting sub but I did it worng or something because it would try and hide after each craft attempt
X
I replied in your quote usung red :D
-
In this particular example I set a veriable %ToHide in the setup portion but you should still get the point. The idea is to deal with hiding before moving on to the rest of the logic (in the setup subs I don't even give the user the option to try hiding if the skill is less than 20 unless they are human). Ok so the script will continue to try while h is not in the character status? What does the && do?
The && means that both conditions have to be met before it will go into the if statement.
So while %ToHide = yes && H notin #CHARSTATUS means that %ToHide has to be yes and H cannot be in the #charstatus in order for it to run the if statement.
Don't do it in the sub, do it after you return from the sub. I tried doing it at the beginning of my crafting sub but I did it worng or something because it would try and hide after each craft attempt
you need to write your hide in an if statement if it is in your med sub or even after your med sub. This was shown by XII. This is a while loop that runs under that condition. Basically it is the same as an if statement in how it is used.
while %ToHide = yes && H notin #CHARSTATUS
{
event macro 13 21
wait 11s ;<------ you can skip this if you don't plan to use another skill afterward
}
-
Jeeze, I never saw that reply last week Crisis, sorry. Thanks for the fill in Tidus!!