SphereCommunity
Client Cycle - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Submissions (/Forum-Script-Submissions)
+--- Thread: Client Cycle (/Thread-Client-Cycle)



Client Cycle - Ultima One - 05-16-2013 12:48 AM

Time to share some scripts we use frequently on TUP. Some may be in need of updating.

Client Cycle is a script to just cycle through all logged in clients, we use it when we want to just check up on everyone, make sure they are not doing something they shouldn't be.

Use: .cycle

Code:
//********************************************************************//
//                                  CYCLE                             //
//********************************************************************//

[FUNCTION cycleinit]
  SRC.TAG.GOCLI_CYCLE    = 0
  SRC.TAG.CYCLE        =

[FUNCTION cycle]
  ctag.admin_numplayers=0
  SERV.ALLCLIENTS admin_getplayers
  
  if ( 0<SRC.TAG.GOCLI_CYCLE> == 0 )
     SRC.cycleinit
  elseif ( <SRC.TAG.GOCLI_CYCLE> == <EVAL <CTAG0.ADMIN_NUMPLAYERS>> )
     SRC.cycleinit
  endif

  IF !( <SERV.CLIENT.<SRC.TAG.GOCLI_CYCLE>.UID>=<SRC.UID> )
      IF ( <SERV.CLIENT.<SRC.TAG.GOCLI_CYCLE>.ACCOUNT.PLEVEL> >= 6)
          SRC.TAG.GOCLI_CYCLE    = <eval (<SRC.TAG.GOCLI_CYCLE> + 1)>
      ENDIF
             SERV.LOG <SRC.NAME>[<SRC.ACCOUNT>] cycles to <SERV.CLIENT.<SRC.TAG.GOCLI_CYCLE>.NAME>[<SERV.CLIENT.<SRC.TAG.GOCLI_CYCLE>.ACCOUNT>][<SERV.CLIENT.<SRC.TAG.GOCLI_CYCLE>.P>]
             GOCLI            = <SRC.TAG.GOCLI_CYCLE>
  ENDIF
  SRC.TAG.GOCLI_CYCLE    = <eval (<SRC.TAG.GOCLI_CYCLE> + 1)>


  if ( <SRC.TAG.GOCLI_CYCLE> >= <EVAL <CTAG0.ADMIN_NUMPLAYERS>> )
     SRC.cycleinit
     return 0
  endif