The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with diconnect timer
Author Message
dabritmusic
Journeyman
*

Posts: 50
Likes Given: 8
Likes Received: 2 in 1 posts
Joined: Nov 2013
Reputation: 0



Post: #1
Problem with diconnect timer
hi i have a vet/afk system. basically sends out a message to all clients every 15 minutes. they have to type .continue xxxx in order to keep playing. otherwise they are disconnected. they are rewarded with a vet point if they comply. i use this because i have a time reward system and i don't want players going afk to reap the benefits... how do i make it a random number on the .continue. i don't want them to be able to macro it. also the disconnect isn't working correctly. any suggestions? thanks... im slowly getting the hang of things! sorry for all the questions. i haven't dabbled with sphere for over 6 years, appreciate all the feedback my posts get!

[ITEMDEF i_verification_obj]
ID=i_crystal_ball
NAME=Verification Object [DO NOT REMOVE]
WEIGHT=5000 // Just to make sure...
TYPE=t_script

ON=@Create
ATTR=attr_decay

ON=@DClick
IF (<SRC.ISGM>)
SRC.SYSMESSAGE Initialized.
TIMER=60*15 // Fifteen minutes
ENDIF
RETURN 1

ON=@Timer
SERV.ALLCLIENTS f_verification
TIMER=60*15 // Activate timer once again.
RETURN 1


[ITEMDEF i_disconnect_obj]
ID=i_memory
NAME=Disconnect Object
WEIGHT=0
TYPE=t_eq_script

ON=@Create
ATTR=attr_invis|attr_decay

ON=@Timer
CONT.DISCONNECT
REMOVE
RETURN 1

[FUNCTION f_verification]
LOCAL.CODE += <EVAL (<UID> / <FINDLAYER(21).COUNT>) 3>
SERV.NEWITEM=i_disconnect_obj
NEW.CONT=<UID>
NEW.MORE1=<LOCAL.CODE>
NEW.TIMER=60*3 // Three minutes.
MESSAGE @077a Please type .Continue <dLOCAL.CODE> to continue playing.

[PLEVEL 1]
Continue

[FUNCTION Continue]
IF (<FINDID(i_disconnect_obj).UID>)
IF !STRCMPI(<ARGS>,Code)
SYSMESSAGE @077a Current verification code is: <dFINDID(i_disconnect_obj).MORE1>.
RETURN 1
ENDIF
IF (<ARGS>==<FINDID(i_disconnect_obj).MORE1>)
SYSMESSAGE @077a You may continue playing.
FINDID(i_disconnect_obj).REMOVE
SYSMESSAGE @077a Incorrect. You will be disconnected in <dFINDID(i_disconnect_obj).TIMER> seconds.
ENDIF
tag0.vp= (<tag0.vp> +1 )
sysmessage @0481 You have earned a veteran reward point, you now have : <eval <tag0.vp>>!
ENDIF
ELSE
SYSMESSAGE @077a No verification code currently active.
ENDIF

[EOF]
02-12-2014 08:24 AM
Find all posts by this user Like Post Quote this message in a reply
Alaric
Journeyman
*

Posts: 227
Likes Given: 7
Likes Received: 9 in 4 posts
Joined: Oct 2012
Reputation: 7



Post: #2
RE: Problem with diconnect timer
I would use server timerf, set "var.timevalue" and fill it with random number. Now show dialog/or spread message.
Then again, timerf for countdown on players (i think you can clear a specific timer(this would do the .continue <number> function) and if it expires -> disconnect).

Better would be creating a dialog with some random things than this message. Taking the message with external apps and comparing is easier than comparing pixels and pictures in dialog. From time to time you'll have to change the system or create database big enough that it won't worth creating automatic external script.

E: Imho, this is not a good way to keep players playing for fun. But to piss them off.
(This post was last modified: 02-12-2014 09:06 AM by Alaric.)
02-12-2014 09:02 AM
Find all posts by this user Like Post Quote this message in a reply
amonvangrell
Banned

Posts: 337
Likes Given: 17
Likes Received: 32 in 20 posts
Joined: Aug 2012

britannia shard

Post: #3
RE: Problem with diconnect timer
(02-12-2014 09:02 AM)Alaric Wrote:  E: Imho, this is not a good way to keep players playing for fun. But to piss them off.

agreed.
02-12-2014 11:59 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
dabritmusic
Journeyman
*

Posts: 50
Likes Given: 8
Likes Received: 2 in 1 posts
Joined: Nov 2013
Reputation: 0



Post: #4
RE: Problem with diconnect timer
lol yea for sure. is there a way to add this to a idled client? like if a client idles for longer than say 15 mins it pops up dialog d_continue with a button to continue etc... and if they dont click the button within 60 seconds it disconnects them...

[dialog d_continue]
200,200
resizepic -1 0 9250 493 207
resizepic 16 16 9300 462 174
dtext 120 40 800 Reborn Legends Anti AFK System
dtext 40 70 100 Click the button to continue playing!
dtext 200 120 800 CONTINUE:
button 300 125 2103 2104 1 0 1

[dialog d_continue button]
ON=1
sysmessage @0481 You may continue playing!
ENDIF
02-12-2014 04:29 PM
Find all posts by this user Like Post Quote this message in a reply
Shidhun
Journeyman
*

Posts: 59
Likes Given: 5
Likes Received: 3 in 3 posts
Joined: Jul 2012
Reputation: 1



Post: #5
RE: Problem with diconnect timer
I'd suggest a passive Check, if they are only idling.

Set a Timestamp on every trigger that you like :

Code:
//Speechfile
on=*
IF (<ACCOUNT.PLEVEL>==1)&&((<ARGN1>==0)||(<ARGN1>==2)||(<ARGN1>==8))
TAG.LastAction=<SERV.TIME>

// Triggers
on=@whatever
TAG.LastAction=<SERV.TIME>

Then, simply check, if the Tag was set within a defined amount of time :

IF (<EVAL <TAG0.LastAction>+6000> > <SERV.TIME>)//Char has done anything in the last 10 Minutes
    //Add your function for gaining a "vet"-point
ENDIF
02-12-2014 07:58 PM
Find all posts by this user Like Post Quote this message in a reply
dabritmusic
Journeyman
*

Posts: 50
Likes Given: 8
Likes Received: 2 in 1 posts
Joined: Nov 2013
Reputation: 0



Post: #6
RE: Problem with diconnect timer
ill scratch the whole vet thing with that system. ill just use that for time reward. i just hate idled clients. unnecessary lagg.
02-13-2014 08:32 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 4 Guest(s)