Time control script

budyniowski

Dedicated Member
Dedicated Member
Dec 16, 2007
149
0
63
Warsaw, Poland
Helo.
I want write scrip, who display system message every hour (You play one hour, you play two hours, you play thre hours... go eat some...) but my script wont work ;(
Maby someon know what i do wrong, or maby someon know simplest way to make this script?

EDIT:
I put this in 00defaul :
[@_UserRest]
#CALL [\System\Rest.txt] @getrest
And this in System\Rest.txt :
[@getrest]
{
#IF
#ACT
mov D1 0 ; H
mov D2 0 ; M
mov D3 0 ; S
[@zliczaj]
#ACT
inc D3 1

#IF
equal D3 60
#ACT
MOV D3 0
INC D2 1

#IF
equal D2 60
#ACT
MOV D2 0
INC D1 1

#IF
equal D1 24
#ACT
MOV D2 0
MOV D1 0
MOV D3 0

#IF
equal D2 1
equal D3 0
#ACT
SysMsg "You play 1 min"

#IF
equal D2 2
equal D3 0
#ACT
SysMsg "You play 2 min..."

#IF
equal D2 3
equal D3 0
#ACT
SysMsg "You play 3 min... get some rest"
delaygoto [grobal] 1 @zliczaj
}
 
Last edited:

Inflikted

LOMCN Veteran
Veteran
Aug 4, 2003
256
7
114
well i can't really follow your script.. but here are some helpful commands that might lead you to the right direction...
for atleast tell server time properly.. and then executing a script off that.

#IF
Min 00 01 (if the server time is between XX:00-01 then something will happen next..
#ACT
............
or
#IF
Hour 00 03 (if server time is between 00:00 hours and 03:00 hours then something will execute.
#ACT

........

there is a way to technically record the time i suppose (i think lol).. but it requires SQL. in default00.txt, you need to record the time the user enters onto the server by using Hour and Min then moving it to a variable and adding it with a string into SQL.... and everytime you want the server to spam a message saying how many hours you have been on. it pulls the values from SQL for that certain user, then subtracts it from the current time

but im guessing this will also create random lag jolts each time this occurs.. because it has to access the db for every single user that is on.
 
Last edited:
Upvote 0

idaBigA

Holley Mir 3!!
VIP
Oct 28, 2003
1,966
110
310
Stoke, UK
This is already done in the standard 3.55 files..

Just have a look @ BingGooo.txt in the HLSCRIPT folder.

This is called from the 00Default.txt file..

Here is mine I have slightly edited. Tells you every 30 mins how long you have been online (up to 10 hours when it starts again).


Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[@BingGooo]
{
#IF
#ACT
SysMsg "Every 30 mins you remain online you have a chance of getting a reward!!"
Delaygoto [Local] 1800 @_Award1

[@_Award1]
#IF
Random 10
#Act
Give Integral(1) 1
SysMsg "<$USERNAME>, Congratulations!! Here is a bonus, Integral(1)!"
SysMsg "You have been online 30 mins"
Delaygoto [Local] 1800 @_Award2
#Elseact
SysMsg "You have been online 30 mins"
Delaygoto [Local] 1800 @_Award2

[@_Award2]
#IF
Random 10
#Act
Give Integral(1) 2
SysMsg "<$USERNAME>, Congratulations!! Here is a bonus, Integral(1) * 2!"
SysMsg "You have been online 60 mins"
Delaygoto [Local] 1800 @_Award3
#Elseact
SysMsg "You have been online 60 mins"
Delaygoto [Local] 1800 @_Award3


[@_Award3]
#IF
Random 10
#Act
Give Integral(1) 1
SysMsg "<$USERNAME>, Congratulations!! Here is a bonus, Integral(1)!"
SysMsg "You have been online 90 mins"
Delaygoto [Local] 1800 @_Award4
#Elseact
SysMsg "You have been online 90 mins"
Delaygoto [Local] 1800 @_Award4


[@_Award4]
#IF
Random 10
#Act
Give Integral(1) 3
SysMsg "<$USERNAME>, Congratulations!! Here is a bonus, Integral(1) * 3!"
SysMsg "You have been online 120 mins"
Delaygoto [Local] 1800 @_Award5
#Elseact
SysMsg "You have been online 120 mins"
Delaygoto [Local] 1800 @_Award5


[@_Award5]
#IF
Random 10
#Act
Give Integral(1) 1
SysMsg "<$USERNAME>, Congratulations!! Here is a bonus, Integral(1)!"
SysMsg "You have been online 150 mins"
Delaygoto [Local] 1800 @_Award6
#Elseact
SysMsg "You have been online 150 mins"
Delaygoto [Local] 1800 @_Award6


[@_Award6]
#IF
Random 10
#Act
Give Integral(1) 1
SysMsg "<$USERNAME>, Congratulations!! Here is a bonus, Integral(1)!"
SysMsg "You have been online 180 mins"
Delaygoto [Local] 1800 @_Award7
#Elseact
SysMsg "You have been online 180 mins"
Delaygoto [Local] 1800 @_Award7


[@_Award7]
#IF
Random 10
#Act
Give Integral(1) 1
SysMsg "<$USERNAME>, Congratulations!! Here is a bonus, Integral(1)!"
SysMsg "You have been online 210 mins"
Delaygoto [Local] 1800 @_Award8
#Elseact
SysMsg "You have been online 210 mins"
Delaygoto [Local] 1800 @_Award8


[@_Award8]
#IF
Random 2
#Act
Give Integral(1) 1
SysMsg "<$USERNAME>, Congratulations!! Here is a bonus, Integral(1)!"
SysMsg "You have been online 240 mins"
Delaygoto [Local] 1800 @_Award9
#Elseact
SysMsg "You have been online 240 mins"
Delaygoto [Local] 1800 @_Award9


[@_Award9]
#IF
Random 10
#Act
Give Integral(1) 1
SysMsg "<$USERNAME>, Congratulations!! Here is a bonus, Integral(1)!"
SysMsg "You have been online 270 mins"
Delaygoto [Local] 1800 @_Award10
#Elseact
SysMsg "You have been online 270 mins"
Delaygoto [Local] 1800 @_Award10


[@_Award10]
#IF
Random 10
#Act
Give Integral(1) 2
SysMsg "<$USERNAME>, Congratulations!! Here is a bonus, Integral(1) * 2!"
SysMsg "You have been online 300 mins"
Delaygoto [Local] 1800 @_Award11
#Elseact
SysMsg "You have been online 300 mins"
Delaygoto [Local] 1800 @_Award11


[@_Award11]
#IF
Random 10
#Act
Give Integral(1) 1
SysMsg "<$USERNAME>, Congratulations!! Here is a bonus, Integral(1)!"
SysMsg "You have been online 330 mins"
Delaygoto [Local] 1800 @_Award12
#Elseact
SysMsg "You have been online 330 mins"
Delaygoto [Local] 1800 @_Award12


[@_Award12]
#IF
Random 10
#Act
Give Integral(1) 1
SysMsg "<$USERNAME>, Congratulations!! Here is a bonus, Integral(1)!"
SysMsg "You have been online 360 mins"
Delaygoto [Local] 1800 @_Award13
#Elseact
SysMsg "You have been online 360 mins"
Delaygoto [Local] 1800 @_Award13


[@_Award13]
#IF
Random 10
#Act
Give Integral(1) 1
SysMsg "<$USERNAME>, Congratulations!! Here is a bonus, Integral(1)!"
SysMsg "You have been online 390 mins"
Delaygoto [Local] 1800 @_Award14
#Elseact
SysMsg "You have been online 390 mins"
Delaygoto [Local] 1800 @_Award14


[@_Award14]
#IF
Random 10
#Act
Give Integral(1) 1
SysMsg "<$USERNAME>, Congratulations!! Here is a bonus, Integral(1)!"
SysMsg "You have been online 420 mins"
Delaygoto [Local] 1800 @_Award15
#Elseact
SysMsg "You have been online 420 mins"
Delaygoto [Local] 1800 @_Award15


[@_Award15]
#IF
Random 10
#Act
Give Integral(1) 1
SysMsg "<$USERNAME>, Congratulations!! Here is a bonus, Integral(1)!"
SysMsg "You have been online 450 mins"
Delaygoto [Local] 1800 @_Award16
#Elseact
SysMsg "You have been online 450 mins"
Delaygoto [Local] 1800 @_Award16


[@_Award16]
#IF
Random 10
#Act
Give Integral(1) 1
SysMsg "<$USERNAME>, Congratulations!! Here is a bonus, Integral(1)!"
SysMsg "You have been online 480 mins"
Delaygoto [Local] 1800 @_Award17
#Elseact
SysMsg "You have been online 480 mins"
Delaygoto [Local] 1800 @_Award17


[@_Award17]
#IF
Random 10
#Act
Give Integral(1) 1
SysMsg "<$USERNAME>, Congratulations!! Here is a bonus, Integral(1)!"
SysMsg "You have been online 510 mins"
Delaygoto [Local] 1800 @_Award18
#Elseact
SysMsg "You have been online 510 mins"
Delaygoto [Local] 1800 @_Award18


[@_Award18]
#IF
Random 10
#Act
Give Integral(1) 1
SysMsg "<$USERNAME>, Congratulations!! Here is a bonus, Integral(1)!"
SysMsg "You have been online 540 mins"
Delaygoto [Local] 1800 @_Award19
#Elseact
SysMsg "You have been online 540 mins"
Delaygoto [Local] 1800 @_Award19
}


[@_Award19]
#IF
Random 10
#Act
Give Integral(1) 1
SysMsg "<$USERNAME>, Congratulations!! Here is a bonus, Integral(1)!"
SysMsg "You have been online 600 mins"
Delaygoto [Local] 1800 @_Award1
#Elseact
SysMsg "You have been online 600 mins"
Delaygoto [Local] 1800 @_Award1
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
Upvote 0