Author Topic: sCnt timer questions...  (Read 4506 times)

0 Members and 1 Guest are viewing this topic.

Offline DeadIssue2Topic starter

  • Sr. Member
  • *
  • Posts: 287
  • Activity:
    0%
  • Reputation Power: 3
  • DeadIssue2 has no influence.
  • Gender: Male
  • Respect: +21
  • Referrals: 1
    • View Profile
sCnt timer questions...
« on: March 20, 2009, 11:12:18 AM »
0
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.

Offline _C2_

  • AFK FtW
  • Global Moderator
  • *
  • *
  • Posts: 4077
  • Activity:
    0%
  • Reputation Power: 48
  • _C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!
  • RIP Pen Trick
  • Respect: +254
  • Referrals: 4
    • View Profile
Re: sCnt timer questions...
« Reply #1 on: March 20, 2009, 11:27:26 AM »
0
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 )
« Last Edit: March 20, 2009, 11:29:07 AM by _C2_ »

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: sCnt timer questions...
« Reply #2 on: March 20, 2009, 11:28:10 AM »
0
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
Exevent SkillLock
#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.
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: sCnt timer questions...
« Reply #3 on: March 20, 2009, 11:44:21 AM »
0
Also, be careful of your handoff between the different levels.  You are going to want something like this:

Code: [Select]
  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:

Code: [Select]
  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.
« Last Edit: March 20, 2009, 12:32:27 PM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: sCnt timer questions...
« Reply #4 on: March 20, 2009, 02:18:49 PM »
0
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.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline DeadIssue2Topic starter

  • Sr. Member
  • *
  • Posts: 287
  • Activity:
    0%
  • Reputation Power: 3
  • DeadIssue2 has no influence.
  • Gender: Male
  • Respect: +21
  • Referrals: 1
    • View Profile
Re: sCnt timer questions...
« Reply #5 on: March 20, 2009, 04:15:19 PM »
0
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.

Offline DeadIssue2Topic starter

  • Sr. Member
  • *
  • Posts: 287
  • Activity:
    0%
  • Reputation Power: 3
  • DeadIssue2 has no influence.
  • Gender: Male
  • Respect: +21
  • Referrals: 1
    • View Profile
Re: sCnt timer questions...
« Reply #6 on: March 20, 2009, 05:13:58 PM »
0
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.

Code: [Select]
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]

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: sCnt timer questions...
« Reply #7 on: March 21, 2009, 04:42:15 AM »
0
The only problem I see is this:

Code: [Select]
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:

Code: [Select]
\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.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline DeadIssue2Topic starter

  • Sr. Member
  • *
  • Posts: 287
  • Activity:
    0%
  • Reputation Power: 3
  • DeadIssue2 has no influence.
  • Gender: Male
  • Respect: +21
  • Referrals: 1
    • View Profile
Re: sCnt timer questions...
« Reply #8 on: March 21, 2009, 07:10:52 AM »
0
And one more time for the guy who doesn't know what your talking about :)

what does the F7 and F8 key do????????


Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: sCnt timer questions...
« Reply #9 on: March 21, 2009, 08:10:55 AM »
0
F6 step into
F7 step out
F8 step over

Also, you can use the info I put HERE to put up a status window. Shows you where your script is hanging up....
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: sCnt timer questions...
« Reply #10 on: March 21, 2009, 11:18:49 AM »
0
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.
Please read the ScriptUO site RULES
Come play RIFT with me!

Tags: