ScriptUO
Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: welgill on September 02, 2009, 03:21:35 PM
-
Ok now that I have a basic script going I guess it should go here.
I have a couple of problems that are stumping me
1) It seems it is ignoring the return commands it just goes on to next area
2) it keeps opening the buffbar over and over usualy to different place than setup
Other than that it casts the spells long way to go but its definitly coming along will post the code here let me know if you see something that might be screwing me up
Updated to 1.5 bit of a rewrite
;==================================
; Script Name:WeaverAssist
; Author:Welgill
; Version: 1.5
; Client Tested with:
; EUO version tested with:1.5
; Shard OSI / FS:Osi
; Revision Date:
; Public Release:
; Global Variables Used:
; Purpose: Script will keep spellweaving buffs up to date and active will also keep bless going
; Script requires EN's ScanBuffBar subs that can be downloaded from this URL http://www.easyuo.com/forum/viewtopic.php?t=28548 or http://www.scriptuo.com/index.php?topic=1508.msg11033#msg11033
;==================================
set %mana 50
gosub setup
main:
repeat
if #TARGCURS = 0
gosub buffs
if #TARGCURS = 1
gosub waiting
until #CHARGHOST = yes
while #CHARGHOST = yes
goto main
sub buffs
Call ScanBuffBar.txt
set %ae _ArcaneEmpowerment_ NOTIN %BuffBarIconNames
if %ae = #true
{
Gosub Ae
}
wait 2s
return
set %at _Atunement_ NOTIN %BuffBarIconNames
if %at = #true
{
Gosub At
}
wait 2s
return
set %GoR _ArcaneEmpowerment_ NOTIN %BuffBarIconNames
if %GoR = #true
{
Gosub GoR
}
wait 2s
return
set %GoL _GiftOfLife_ NOTIN %BuffBarIconNames
if %GoL = #true
{
Gosub GoL
}
wait 2s
return
sub GoL
if #MANA < %mana
{
gosub Med
}
Event Macro 15 615
target 4s
Event Macro 23 0
return
sub GoR
if #MANA < %mana
{
gosub Med
}
Event Macro 15 602
target 4s
Event Macro 23 0
return
sub Ae
if #MANA < %mana
{
gosub Med
}
Event Macro 15 616
wait 2s
return
sub At:
if #MANA < %mana
{
gosub Med
}
Event Macro 15 604
wait 2s
return
sub setup
event macro 8 1
wait 5
contpos 650 0
wait 5
event macro 8 2
wait 5
contpos 650 500
wait 5
event macro 8 7
wait 5
contpos 615 330
wait 5
Call ScanBuffBar.txt 1 493
return
sub med
repeat
if #MANA < %mana
wait 30
until #MANA > %mana
return
sub waiting
wait 60
return
-
You dont have a loop in teh script thierfor the script reaches the last line .. and starts over constantly.
Try this - Remove gosub main from the setup sub and replace gosub setup with below
;==================================
Initevents ; <-- this does nothing .. old dead command
gosub setup
set !ExitScript #False
Repeat
Gosub Main
wait 20
Until !ExitScript = #True
Halt
-
absolutly great EM never would have thought of a loop there
ok now to hit the cast wait and the spell cooldowns woot
-
welgill, good start. I recommend you drop by the Script Tutorial section and read up. Some basic "flow" information in there that will help you to organize your script better.
-
will do Cerveza
-
Ok I have found the cooldown timer for Gift of Renewal.
It is 2 1/2 min or 150 sec or so from end of spell.
What would be the best way to start a timer when the buff bar scanner doesnt see the icon there any more without getting stuck in just that sub so it can keep other spells up while waiting?
oh and did a bit of a rewrite to improve flow and some other minor improvments
-
absolutly great EM never would have thought of a loop there
ok now to hit the cast wait and the spell cooldowns woot
Another thing you could do is put that med check into each check to cast each specific spell, and if the spell needs to be cast, then check to see if there's enough mana, and if there's NOT enough mana, set the %med to whatever that SPECIFIC spells mana - lmc) requirement is. :) That way it meds to that spells mana requirement as fast as possible and the script is more efficient... does that make sense? :) You could also have a med active check so med doesn't get interrupted... Like a repeat until %mana = !manarequiredforspecificspell then continue type deal. :) Not sure how you want to use this script tho, I didn't read the top of the script. I should do that.
-
I am not the best at paying attn to things while i fight so it just keeps buffs active while hunting
and I fixed the med loop and the mainloop thanks to a tutorial in our AWSOME tutorial section :)
<gratutitous butt kissing not intended Cerv>
-
I am not the best at paying attn to things while i fight so it just keeps buffs active while hunting
and I fixed the med loop and the mainloop thanks to a tutorial in our AWSOME tutorial section :)
<gratutitous butt kissing not intended Cerv>
Well UPDATE THE SCRIPT IN THIS THREAD! haha It's hard to help if we're working with old code. Here's my curse weapon sub that casts curse weapon and updates it's timer so the script will cast it on time every time. I have an equation that calculates !CurseWepCastTime then I just add that to #sysTime and then have the script recast when it's timing is up.
sub CurseWeapon ; 7 mana
menu get 25 ; Curse Weapon
IF #menures = #true
{
chooseSkill chiv
IF !CRWTimer > #sysTime || #mana < %mana_required_0
{
IF #mana < %mana_required_0 && !WarningDelay < #sCnt
{
SET !WarningDelay #sCnt + 5
EVENT exMsg #charId 3 55 Low Mana Curse Weapon!
}
RETURN
}
gosub UpdateTitleBar
menu delete status
menu font color red
menu font bgcolor gray
menu text status 225 177 Casting Curse Weapon!
event Macro 15 104
SET !CRWTimer #sysTime + !CurseWepCastTime
gosub ls
SET !CWCount !CWCount + 1
RETURN
-
so instead of having it check buffbar for Gift of life and gift of renewal just have it cast whenever the cooldown alows
thats a good idea will work out the subs tonight
-
so instead of having it check buffbar for Gift of life and gift of renewal just have it cast whenever the cooldown alows
thats a good idea will work out the subs tonight
Yea you just have it loop through the cast sub, and if the timing isn't up, you return out. And if the timing IS up, you recast. Simple. You have to check the sub a lot tho. Which shouldn't be a problem if it's just a looping script to make sure that all the spells stay cast.