ScriptUO
Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: Tana on June 06, 2016, 12:43:35 AM
-
Hey guys ive been messing with a script that trys to med when mana is low however im trying to use ens buff bar to see if my char is meditating but its not working properly. not sure what to do to fix the sub can someone give it a look?
Sub mana
if #mana < 30
{
medloop:
event macro 13 46
wait 11s
call ScanBuffBar
wait 10
if _Meditation_ in %BuffBarIconNames
{
gosub wait
}
if #mana < #maxmana
{
goto medloop
}
}
return
sub wait
Repeat
wait 1
until #mana = #maxmana
return
not sure what im doing wrong but it ignores the buff and keeps casting med over and over instead of repeating the wait.
-
well i i ended up using TMs med sub found here http://www.scriptuo.com/index.php?topic=1527.0 id still like to know what i did wrong with ENs scanbuffbar so i can use it in later scripts
Sub mana
if #mana < 30
{
gosub meditate #true 0
return
-
Does your Easy ans scanbar in the same folder.
-
yes ghost my EUO and my scanbuffbar are in the same folder. i double checked that when i was trying to figure out what was wrong with it and sure enough its in there
-
I testing with this and it work.
First u need to call scan at the begining just before your main loop.
second. You had a extra space before _ Meditation.
call ScanBuffBar
while #true
{
goSub mana
}
Sub mana
if #mana < 30
{
medloop:
event sysmessage meditation
event macro 13 46
wait 11s
call ScanBuffBar
if _Meditation_ in %BuffBarIconNames
{
event sysmessage Waiting
gosub wait
}
if #mana < #maxmana
{
goto medloop
}
}
return
sub wait
Repeat
wait 1
until #mana = #maxmana
return
-
ok ghost i tried what you said i still cant get it to work! not sure what im doing wrong at all!! heres the entire script its a simple mastery trainer this one is currently written for taming.
set %getpet #true
Call ScanBuffBar
Repeat
if %getpet = #true
{
Gosub pet
}
gosub mana
gosub train
until #false
sub pet
finditem %pet
if #findcnt < 1
{
display Select pet to train on
set #targcurs 1
while #targcurs = 1
{
wait 1
}
set %pet #LTARGETID
}
set %getpet #false
Return
Sub train
event macro 15 744
target 4s
set #LTARGETID %pet
event macro 22 0
wait 20
return
Sub mana
if #mana < 30
{
medloop:
event sysmessage meditation
event macro 13 46
wait 11s
call ScanBuffBar
if _Meditation_ in %BuffBarIconNames
{
event sysmessage Waiting ;<<<<<<<<<<<<<<<<<< i dont get this system message so the scan buff bar isnt returning a value.
gosub wait
}
if #mana < #maxmana
{
goto medloop
}
}
return
sub wait
Repeat
wait 1
until #mana = #maxmana
return
-
event sysmessage ( insert text) allow you see the flow of your sub. I have add the meditation to see when and how often it use the skill. The waiting to see when it just to that part of the sub. Those msg will appear in the bottom left of your UO window. That help me debug.
-
right the message didn't pop up for me telling me that the if statement is returning false, not sure why its returning false tho.
-
did u try to just run that submana alone
-
i have not. just tried throwing it in the script. ill try just the sub and see if that helps
-
run this code
call ScanBuffBar
event sysmessage %BuffBarIconNames
If you get the response of N/A then the buffbar code is not in the same directory as easyuo and or its not finding the code for some reason.
You are also more than welcome to find and use the meditation sub in my code library's.. sub name meditatefull in file : ens-subs-spellsandrunebooks.txt
-
Thanks for the advice en. The file is in the same location as EUO and i actually had the same idea as that and did it and i get nothing. not sure why tho. i have a modded version of TMs mana sub that works i just wanted it to work correctly if i wrote anything else that needed to use the scanbuffbar sub.
EDIT: the result is _
-
Also i get the variables from scanbuffbar if i do a var dump so it is calling the script.
Another update ran the code call scanbuffbar event sysmessage %BaffBarrIconNames on my samp and it came back with vamp embrace so im guessing its something to do with my master buff.
-
Ow opps thats exactly what it is .. script fails if their are buffs it doesn't have the codes for ... I have an updated version with all buff codes .. just haven't got around to final test and posting...
Will try and see if i can find the time to fix it today.
-
Thanks so much EN! I thought maybe i was doing something wrong glad to know my coding was right lol. As an update to my progress i just hit 120 taming from 90 it took me around 3 days doing nothing but using the mastery.
PS. if anyone wants a copy of Taming Mastery Trainer you can check it out here http://www.scriptuo.com/index.php?topic=13808
-
Buffbar Subs script updated... wrote a little meditate sub as well ...
gosub ENs_BuffbarMeditate
sub ENs_BuffbarMeditate
While #mana < #MaxMana
{
event macro 13 46
Repeat
Call ScanBuffBar
wait 1
Until _Meditation_ notin %BuffBarIconNames || #Mana = #MaxMana
}
return