ScriptUO
Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: DeadIssue2 on March 20, 2009, 11:12:18 AM
-
Okay before I ask my question I will say that I play UO on Siege. We do not use the GGS gain system we use RoT. So gains are as follows:
# Skill points for skills less than 70 points will gain as normal shards.
# Skill points for skills between 70 and 79.9 points will gain a maximum of 5 points per day with a minimum of 5 minutes between points gained. (250 minutes min to gain 5.0 skill)
# Skill points for skills between 80 and 89.9 will gain at a maximum of 4.0 points per day with a minimum of 8 minutes between points gained. (320 minutes min to gain 4.0 skill)
# Skill points for skills between 90 and 99.9 will gain at a maximum of 3.0 points per day with a minimum of 12 minutes between points gained. (360 minutes min to gain 3.0 skill points)
# Skill points for skills between 100 and 109.9 will gain at a maximum of 3.0 skill points per day with a minimum of 15 minutes between points gained. (450 minutes min to gain 3.0 skill points)
# Skill points for skills between 110 and 120 will gain at a maximum of 2.0 skill points per day with a minimum of 15 minutes between points gained. (300 minutes min to gain 2.0 skill points)
# Players will be allowed to gain 15 stat points a day.
So the question is.... I can set up a sCnt timer so that I gain every 5 minutes like this:
set %timer_delay 60 * 5
DO EVERYTHING I WANT DONE
Set %timer #sCnt + %timer_delay
repeat
until #sCnt > %timer
but how can I set it up to automatically check your skill level and adjust the proper amount of minutes based on your skill level.
-
You are going to want to use the chooseskill command. it is typically the first four letters of the skill. there is a chart on easy uo for reference. if you were using fencing for example it would look like this...
chooseskill fenc
that will look at the actual skill level that you have. then you could do a set timer sub like this every round. or vary it as needed but you will get the idea.
something like...
chooseskill fenc
if #skill >= 1100 (110.0)
set %timer_delay ( 60 * 15 )
more ....
if #skill < 800
set %timer_delay ( 60 * 5 )
-
Good start, little changing you need to make....
set %timer_delay 60 * 5
Might not work, you might end up with %timer_delay = 60. Probably better to use:
set %timer_delay ( 60 * 5 )
Now... you want to check skills eh? Simple enough.
chooseSkill (http://wiki.easyuo.com/index.php/ChooseSkill)
Exevent SkillLock (http://wiki.easyuo.com/index.php/Exevent_SkillLock)
#skill (http://wiki.easyuo.com/index.php/Skill)
I think if you look at those you'll start to see how you can setup skill checking to determine what you level is at start, and what your level currently is. You could even change your timers based on that.
-
Also, be careful of your handoff between the different levels. You are going to want something like this:
if #SKILL < 700
set %new_time TIME1
if #SKILL >= 700 && #SKILL < 800
set %new_time TIME2
if #SKILL >= 800 && #SKILL < 900
set %new_time TIME3
... etc
My point about the handoff is kind described by this example:
if #SKILL < 700
set %new_time TIME1
if #SKILL > 700 && #SKILL < 799 ; note the change here.
...
You'll notice that everything works well up to 69.9 skill, but when you reach 70.0, the script will get stuck because there is no way to get past 70.0. I see this issue alot on EasyUO. I remember a couple times when people claimed their script just "works" when you can obviously find that subtle runtime bug.
Edit:
Even crafting this response, I got the logic wrong. lol. Should be fixed now.
-
Another thought about system variables. These are the ones with the "#" prefix. These function in different ways. Some update automatically (i.e. #TIME, #SCNT, etc), some update but only if you have your character status open, and some update only when you call a specific command, i.e.:
#JOURNAL -> requires scanjournal
#SKILL -> requires chooseskill
#PIXCOL -> requires savepix, cmpPix
#FINDID, #FINDCNT, #FINDCOL, #FINDX(Y)(Z), etc -> finditem
There's a few others here, but you get the general idea. Before you use one of the system variables, it's best to look them up and see if you are using them correctly. If you use SUO, you can use the Tools/EasyUO Wiki menu to surf directly to the specific help section. It's quite handly.
-
This may be stinkin' thinkin' so correct me if I am way off but combining all this information wouldn't or couldn't I set the delay times like this
Set %timer_delay1 ( 60 * 5 )
Set %timer_delay2 ( 60 * 8 )
Set %timer_delay3 ( 60 * 12 )
Set %timer_delay4 ( 60 * 15 )
and then tie them in with a skill check like:
if #skill >= 700 && #skill <800
Set %timer #sCnt + %timer_delay1
repeat
until #sCnt > %timer
if #skill >= 800 && #skill <900
Set %timer #sCnt + %timer_delay2
repeat
until #sCnt > %timer
and so on with all the different levels of skill timer??? And yes this assumes that one of my first lines is chooseskill parry. I was understanding that once you use the chooseskill command it is like turning it on and will continue to update that info without asking for it again.
-
There is no doubt this does not work but I want to know why and then of course how should it work. Mind you everything works except the timer for the different skill levels.
set %timer_delay 60
set %timer_delay1 ( 60 * 5 ) ;seconds between summons
set %timer_delay2 ( 60 * 8 )
set %timer_delay3 ( 60 * 12 )
set %timer_delay4 ( 60 * 15 )
Chooseskill Parry
Set %temp_skill #skill
Set %heal_level 70
Loop:
Gosub Summon_EarthElm
repeat
finditem %elemental G_2
until %temp_skill <> #skill || #FINDCNT = 0 ; wait until you get a skillgain or creature dissappears
Gosub Remove_EarthElm
If #hits <= %heal_level
{
Gosub Heal
}
Set %temp_skill #skill
if %skill <= 700
{
set %timer #sCnt + %timer_delay 60
}
if #skill >= 700 && #skill < 800
{
set %timer #sCnt + %timer_delay1
}
if #skill >= 800 && #skill < 900
{
set %timer #sCnt + %timer_delay2
}
if #skill >= 900 && #skill < 1000
{
set %timer #sCnt + %timer_delay3
}
if #skill >= 1000
{
set %timer #sCnt + %timer_delay4
}
repeat
until #sCnt > %timer ; delay for next elemental
Goto Loop
;=====================================================
;= Gosub Summon_EarthElm =
;=====================================================
Sub Summon_EarthElm
Summon_EarthElm1:
while #mana < 50
{
event macro 13 46
wait 5s
}
event macro 15 61
set %timer #SCNT + 10 ; cast timer just incase of fizzle
repeat
finditem ED G_2
until #FINDCNT > 0 || #SCNT > %timer
if #SCNT > %timer
goto Summon_EarthElm1 ; cast again
set %elemental #findid
set #ltargetid %elemental
set #ltargetkind 1
msg all follow me $
wait 1s
msg all follow me $
wait 1s
event macro 1 0 all kill
target 5s
event macro 23 ;target self
wait 1s
event macro 27 ; necessary?
return
;=====================================================
;= Gosub Remove_EarthElm =
;=====================================================
Sub Remove_EarthElm
Finditem %elemental G_2
if #FINDKIND <> -1
{
exevent popup #findid
wait 1s
click 39 163
wait 5s
}
set %elemental N/A
return
;=====================================================
;= Gosub Heal =
;=====================================================
Sub Heal
While #mana < 20
{
event macro 13 46
wait 5s
}
event macro 15 28
wait 2s
event macro 23
wait 1s
return
[code]
[/code]
-
The only problem I see is this:
if %skill <= 700
You probably meant #SKILL?
Also, this is a fine time to talk about debugging. Inserting a "pause" command in a section you want to debug, and then using F7, F8 to step through the code can be SOOOOO enlightening in determine how your code is functioning.
Also, in the pulldown Tools/Manage Varlist, you can enter your own variables to watch. At the end of the list, I generally put:
\Mine
%timer_delay1
%timer_delay2
%temp_skill
%timer
These variables will now appear in the right Pane of EasyUO, under the "Mine" group and will change as your program executes.
-
And one more time for the guy who doesn't know what your talking about :)
what does the F7 and F8 key do????????
-
F6 step into
F7 step out
F8 step over
Also, you can use the info I put HERE (http://www.scriptuo.com/index.php?topic=1146.0) to put up a status window. Shows you where your script is hanging up....
-
That is part of the limited debugging feature of EasyUO. You can also use them when you press the "Pause" button. From there, you can single step through your code (using F7, F8 and F9) and see how it behaves. By using a Pause COMMAND, you can determine the exact code line to start your debugging effort.