Author Topic: Problems with Skill Gaining calculator script  (Read 2900 times)

0 Members and 1 Guest are viewing this topic.

Offline VicVegaTopic starter

  • Jr. Member
  • **
  • Posts: 71
  • Activity:
    0%
  • Reputation Power: 0
  • VicVega has no influence.
  • Respect: +8
  • Referrals: 0
    • View Profile
Problems with Skill Gaining calculator script
« on: May 26, 2009, 10:41:51 AM »
0
So this is a script I've made in order to know how much time left for reaching GM status and how much skill points per hour are gained.

The idea it's to execute it in other tab different from the main script.

But I don't know exactly why, after a while the UO ends crashing and I have to close it after a time using the script.

Hope someone finds wich could be the problem.

Code: [Select]
;=================================================================
; Script Name: Skill Gaining Calculator
; Author: VicVega
; Version: 0.1
; Shard OSI / FS: UO Legends
; Revision Date: 26/5/2009
; Purpose: Shows in the UO title bar the skill per hour points you are gaining
;          Also shows the time left to achieve GM level
; Globals: None
;=================================================================
; Instructions: Set the skill you want to check in %skill variable
;************************ Setup **********************************
gosub setup
;*********************** Main Loop *******************************
repeat
  set %skillGained #skill - %startingSkill
  set %timePassed #scnt - %startingTime
  set %skillPerHour ( 3600 * %skillGained ) / %timePassed
  gosub timeLeftToGM
  setuotitle S/H: %skillPerHour GM: %timeLeftToGM S: %skillGained T: %timePassed
  wait 10s
until #charGhost = yes
;************************* Subs **********************************
sub setup
    set %skill anim
    chooseskill %skill
    set %startingSkill #skill
    set %startingTime #scnt
return

sub timeLeftToGM
  if %skillGained > 0
  {
     set %timeLeftToGMSecs ( ( 1000 - #skill ) * %timePassed ) / %skillGained
     gosub ConvertTimeHourMinSec %timeLeftToGMSecs
     set %timeLeftToGM #strres
  }
return

; %1 = input - Time to convert
; #RESULT -  Time converted to H:MM:SS format
sub ConvertTimeHourMinSec
  namespace push
  namespace local ctime
  set !hourpart %1 / 3600
  set !secpart ( %1 % 3600 ) % 60
  set !minpart ( ( %1 % 3600 ) / 60 )

  if !hourpart >= 10
    set #STRRES !hourpart , :
  else
    set #STRRES 0 , !hourpart , :
  if !minpart < 10
    set #STRRES #STRRES , 0
  set #STRRES #STRRES , !minpart , :
  if !secpart < 10
    set #STRRES #STRRES , 0
  set #STRRES #STRRES , !secpart
  namespace pop
return
« Last Edit: May 27, 2009, 12:46:45 AM by VicVega »
To learn, read.
To know, write.
To master, teach.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13303
  • Activity:
    0.4%
  • 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: Problems with Skill Gaining calculator script
« Reply #1 on: May 26, 2009, 11:20:20 PM »
0
Hi Vic, sorry I'm at Disneyland right now, but still want to take a look at this.  I'll have a bit more time Wednesday night, but right now I'm at the hotel here in DLand.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Masscre

  • Gran Master Jester !!
  • Scripthack
  • *
  • Posts: 4615
  • Activity:
    0%
  • Reputation Power: 55
  • Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!
  • Gender: Male
  • Air Guitar Commander !!
  • Respect: +144
  • Referrals: 1
    • View Profile
Re: Problems with Skill Gaining calculator script
« Reply #2 on: May 27, 2009, 12:53:32 PM »
0
Go play forget about the code for a little while have some fun with the family :)

Offline VicVegaTopic starter

  • Jr. Member
  • **
  • Posts: 71
  • Activity:
    0%
  • Reputation Power: 0
  • VicVega has no influence.
  • Respect: +8
  • Referrals: 0
    • View Profile
Re: Problems with Skill Gaining calculator script
« Reply #3 on: May 27, 2009, 11:50:42 PM »
0
I agree, also punch Mickey in the face for me if you have the ocassion, always wanted to do it.  ;D

Look out, he is swinging his arm!

To learn, read.
To know, write.
To master, teach.

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: Problems with Skill Gaining calculator script
« Reply #4 on: May 28, 2009, 05:16:14 AM »
0
I pay top dollar for pictures of Minnie.
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.

Tags: