Jump to content
  • 0

Script request


AOCzxc

Question


  • Group:  Members
  • Topic Count:  29
  • Topics Per Day:  0.01
  • Content Count:  54
  • Reputation:   1
  • Joined:  02/18/18
  • Last Seen:  

I'm looking for stop the clock . Count into 1-1100 not 1000 to 1,  

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

yeah, this script is old school

1 of my server I worked on, I saw players use openkore to cheat this event

 

the openkore detect the announcement 999 then send a packet immediately, and most of the time, cheater wins

I decided to take out this script ever since

 

weird, our script looks entirely different

//====================================================================
// Credits to:
//          acky, for the original script.
//          Vampy, for adding features to the NPC.
//          ~AnnieRuru~, for telling me how infinite loops work.
//          henrikejg, for telling me how to fix infinite loops.
//====================================================================

prontera,155,171,5	script	Stop The Clock::Ev_StopClock	46,{

set $itemid, 15702;

	if (getgmlevel() == 99) goto L_GM;	
	if ($@kc > 0 && @kcid != $@kcid) goto L_eventstarted;
	mes "[Stop The Clock]";
	mes "Hello ^FF0000"+strcharinfo(0)+"^000000, how can I help you?";
	mes "^FF0000[Note] Stop The Clock starts every Tuesday, Thursday and Saturday at 6:00PM server time.^000000";
	menu "^FF0000[Stop The Clock]^000000 information",L_info,"Exit",-;
	close;
	
L_info:
   next;
   mes "[Stop The Clock]";
   mes "^FF0000Stop the clock^000000 is a game where by players need to try to stop the clock as close to 1000 as possible.";
   next;
   mes "[Stop The Clock]";
   mes "The person that stops the clock closest to 1000 wins!";
   mes "^FF0000[Note] You need to stop the clock between 950 and 1000 to win.^000000";
   next;
   mes "[Stop The Clock]";
   mes "In cases where by there's a draw, all the winners will get a prize. For example, if both John and Tom got 997, both of them will get a prize each.";
   mes "Current prize for winning: ^FF0000"+ 1000 + " " +getitemname($itemid)+" ^000000";
   close;
   
L_eventstarted:
			set @kcid,$@kcid;
			setd ".timing_" + .number, $@kc;
			setd ".player_" + .number + "$", strcharinfo(0);
			set .number, .number+1;
			if ($@kc == 1000) {
         announce "Jackpot! "+strcharinfo(0)+" stopped the clock on "+$@kc+".",0,0x00EEFF;
      } else {
			announce ""+strcharinfo(0)+" stopped the clock on "+$@kc+".",0,0x00EEFF;
			}
         end;
	
L_GM:
      mes "[Stop The Clock]";
      mes "Hello Administrator, what would you like to do?";
      mes "Current prize for winning: ^FF0000"+ 1000 + " " + getitemname($itemid)+"^000000";
      menu "Configure Prize",L_configure,"Start Event",-,"Stop Event",L_stop;
      if (.start == 1) goto L_started;
      next;
      mes "[Stop The Clock]";
      mes "Event started.";
      close2;
      
L_startevent:
      set .start, 1;
		announce "[Stop The Clock] is starting in 1 minute!",0;
		initnpctimer;
		end;		
OnTimer30000:
		if (.start == 0) goto L_suddenstop;
		announce "[Stop The Clock] is starting in 30 seconds!",0;
      end;      
OnTimer50000:
		if (.start == 0) goto L_suddenstop;
		announce "[Stop The Clock] is starting in 10 seconds!",0;
		end;
OnTimer55000:
		if (.start == 0) goto L_suddenstop;
		announce "[Stop The Clock] is starting in 5 seconds!",0;
OnTimer60000:
		if (.start == 0) goto L_suddenstop;
      announce "[Stop The Clock] starts now! Stop the clock as close to 1000 as possible! To stop the clock, just click the NPC.",0;
      stopnpctimer;
		set .number, 1;
		set .count, 1000;
		set .winner, 0;
		set $@kc,0;
		set $@kci,0;
		set $@kcid,rand(100000,999999);
		while ($@kc < 1100) {
			set $@kc,$@kc+1;
			set $@kci,$@kci+1;
			if ($@kci == 100 || ($@kci == 10 && $@kc > 600) || ($@kci == 1 && $@kc >= 950 && $@kc < 1050)) {
            if (.start == 0) goto L_suddenstop;
            announce $@kc,0;
				set $@kci,0;
				specialeffect 18;
			}
         sleep 10;
		}
		set $@kc,0;
		set .start, 0;
		set .players, .number+1;
		
OnFinish:
      sleep 1;
      if (.count == 949) goto OnFinish3;
      if (getd(".timing_" + .number) == .count) goto L_winner1;
      set .number, .number-1;
      if (.number != 0) goto OnFinish;
      set .number, 1;
      if (.winner == 1) goto OnFinish3;
      set .count, .count-1;
      
OnFinish2:
      sleep 1;
      if (.count == 949) goto OnFinish3;
      if (getd(".timing_" + .number) == .count) goto L_winner2;
      set .number, .number+1;
      if (.number != .players) goto OnFinish2;
      set .number, .number-1;
      if (.winner == 1) goto OnFinish3;
      set .count, .count-1;
      goto OnFinish;
      
L_winner1:
      if (getd(".timing_" + .number) == 1000) {
      announce ""+getd(".player_" + .number + "$")+" wins! (Prize x2 for stopping exactly on 1000)",0;
      charcommand "#item " + $itemid + " 2000 " + getd(".player_" + .number + "$");
   } else {
      announce ""+getd(".player_" + .number + "$")+" wins!",0;
      charcommand "#item " + $itemid + " 1000 " + getd(".player_" + .number + "$");
      }
      set .number, .number-1;
      set .winner, 1;
      goto OnFinish;
      
L_winner2:
      if (getd(".timing_" + .number) == 1000) {
      announce ""+getd(".player_" + .number + "$")+" wins! (Prize x2 for stopping exactly on 1000)",0;
      charcommand "#item " + $itemid + " 2000 " + getd(".player_" + .number + "$");
   } else {
      announce ""+getd(".player_" + .number + "$")+" wins!",0;
      charcommand "#item " + $itemid + " 1000 " + getd(".player_" + .number + "$");
      }
      set .number, .number+1;
      set .winner, 1;
      goto OnFinish2;
      
OnFinish3:
      sleep 1;
      set .number, .players-1;
      while (.number != 0) {
      set getd(".timing_" + .number), 0;
      set .number, .number-1;
      }
      end;
      
L_started:
      next;
      mes "[Stop The Clock]";
      mes "Event is already running!";
      close;
      
L_configure:
      next;
      mes "[Stop The Clock]";
      mes "Are you sure you want ^FF0000"+ 1000 + " " + getitemname($itemid)+"^000000 to be the prize of the event?";
      menu "Yes",-,"No",L_no;
      next;
      mes "[Stop The Clock]";
      mes "Prize changed to ^FF0000"+ 1000 + " " + getitemname($itemid)+"^000000.";
	announce "Prize changed to "+ 1000 + " " + getitemname($itemid)+".",0;
      next;
      goto L_GM;
      
L_no:
      close;
      
L_stop:
      next;
      if (.start == 1) {
      mes "[Stop The Clock]";
      mes "The event has already started, do you want to stop the event?";
      menu "Yes",-,"No",-;
      
      if (@menu == 1) {
            next;
            set .start, 0;
            mes "[Stop The Clock]";
            mes "Event Stopped";
            next;
            goto L_GM;
      } else {
            next;
            goto L_GM;
            }
      } else {
      mes "[Stop The Clock]";
      mes "The event hasn't started yet!";
      close;
      }

L_suddenstop:
      announce "[Stop The Clock] was stopped by an Administrator.",0;
      end;
      
OnClock1015:
OnClock2215:
      if (gettime(4) == 1 || gettime(4) == 3 || gettime(4) == 5) end;
      goto L_startevent;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  737
  • Reputation:   47
  • Joined:  03/12/14
  • Last Seen:  

14 minutes ago, AOCzxc said:

I'm looking for stop the clock . Count into 1-1100 not 1000 to 1,  

quiz_00,25,120,3	script	Stop The Clock#02	925,{
	mes "[ Stop The Clock ]";
	mes "Hello "+strcharinfo(0)+",";
	mes "Would you like to warp to the Stop the Clock?";
	menu "Yes",warp_stc,"No",cancel_stc;

warp_stc:
	close2;
	warp "prontera",162,170;
	end;

cancel_stc:
	mes "[ Stop The Clock ]";
	mes "Ok, have a nice day";
	close;
}

prontera,146,192,5	script	Stop The Clock	902,{

if(.game == 1 && getgmlevel() > 0)	{
	message strcharinfo(0), "GM's are not allowed to join this event.";
	end;
	}
if(.game == 1)	{
set .@size,getarraysize($@stoppedstc$);
for (set .@i,0;.@i<.@size;set .@i,.@i+1) {
	if ($@stoppedstc$[.@i] == strcharinfo(0)) {
		message strcharinfo(0), "You already stopped the clock.";
		end;
		}
	}
	set @stopped, .i;
	mapannounce "prontera",""+strcharinfo(0)+" stopped the clock at "+@stopped+".",0;
	set $@stoppedstc$[.cstc],strcharinfo(0);
	set .cstc,.cstc+1;
	if (@stopped >= 1001) {
		set @stopped,0;
		end;
		}
	if(@stopped == .nearest2) {
		set .j,.j+1;
		set .winner$[.j],strcharinfo(0);
		end;
		}
	if (@stopped == 1000) {
 		deletearray .winner2$[.j],getarraysize(.winner$);
		set .j,0;
		set .lowest,@stopped;
		set .winner$[.j], strcharinfo(0);
		set .nearest2,@stopped;
		end;
		}
	if(@stopped == .nearest) {
		set .wins,.wins+1;
		set .winner2$[.wins],strcharinfo(0);
		end;
		}
	if(@stopped >= .lowest) {
    		deletearray .winner2$[.wins],getarraysize(.winner2$);
		set .nearest,@stopped;
		set .lowest,@stopped;
		set .wins,0;
		set .winner2$[.wins],strcharinfo(0);
		end;
		}
	end;
	}

set .@name$, "[ Stop The Clock ]";
set .@menu$, "Information:Prize:Leave";

if(getgmlevel() >= 40) set .@menu$, .@menu$ + ":Start STC event";

mes .@name$;
mes "Hello "+strcharinfo(0)+", how can I help you?";
switch(select(.@menu$))	{
	case 1:
	next;
	mes .@name$;
	mes "Stop the clock is a game where by players need to try to stop the clock as close to 1000 as possible.";
	mes "The person that stops the clock closest and not more than 1000 wins!";
	close;

	case 2:
	mes " ";
	mes "Prize:";
	mes "^0000FF5 Event Token^000000.";
	mes "Jackpot:";
	mes "^0000FF15 Event Token^000000.";
	close;

	case 3:
	close;

	case 4:
	if (.stc_ongoing == 1) {
	next;
	mes .@name$;
	mes "The event is still running!";
	close;
	}
	set .GMName$,strcharinfo(0);
	mes "Stop the Clock started!";
	close2;
	set .stc_ongoing,1;
	goto L_Start;
	}

//OnMinute00:

L_Start:
deletearray $@stoppedstc$[0],getarraysize($@stoppedstc$);
set .cstc,0;
set .nearest2,2000;
set .nearest,2000;
deletearray .winner$[0],getarraysize(.winner$);
deletearray .winner2$[0],getarraysize(.winner2$);
set .winner2$[0], "";
set .lowest, 0;
set .j,0;
set .wins,0;
announce "Stop the Clock at Prontera City ! Starting in 5 seconds!",0;
initnpctimer;
end;

OnTimer3000:
mapannounce "prontera","Stop the clock as close to 1000 as possible! Players who stopped the clock higher than 1000 automatically lose, then those who stopped the clock at exactly 1000 will receive a item! To stop the clock, just click the npc.",0;
end;

OnTimer10000:
announce "Stop the Clock starts now!",0;
stopnpctimer;
set .game, 1;

for(set .i, 0; .i < 300;set .i, .i + 100)	{
		mapannounce "prontera"," "+.i+" ",0;
		misceffect 18;
		sleep2 700;
		}


for(set .i, 300; .i < 600;set .i, .i + 100)	{
		mapannounce "prontera"," "+.i+" ",0;
		misceffect 18;
		sleep2 500;
		}

for(set .i, 600; .i < 950;set .i, .i + 10)	{
		mapannounce "prontera"," "+.i+" ",0;
		misceffect 18;
		sleep2 100;
		}

for(set .i, 950; .i < 1000;set .i, .i + 1)	{
		mapannounce "prontera"," "+.i+" ",0;
		misceffect 18;
		sleep2 20;
		}

for(set .i, 1000; .i < 1050;set .i, .i + 1)	{
		mapannounce "prontera"," "+.i+" ",0;
		misceffect 18;
		sleep2 15;
		}

set .game, 0;

if (.lowest == 1000) {
	set .@size,getarraysize(.winner$);
	for(set .@i,0;.@i<.@size;set .@i,.@i+1) {
	getitem 8040,200,getcharid(3,.winner$[.@i]);
	announce "Jackpot! "+.winner$[.@i]+" stopped the clock at exactly "+.lowest+"!",0;	
	sleep2 1;
	}
	set .stc_ongoing,0;
	end;
} else {
if(.winner2$[.wins] == "") {
	announce "Nobody hit the clock at the right moment. There's no winner.",bc_blue;
	set .stc_ongoing,0;
	end;
	}
	set .@size,getarraysize(.winner2$);	
	for (set .@i,0;.@i<.@size;set .@i,.@i+1) {
			getitem 8040,50,getcharid(3,.winner2$[.@i]);
			announce ""+.winner2$[.@i]+" wins! He stopped the clock at "+.nearest+", Congratulations!.",0;
			sleep2 1;
			}
		set .stc_ongoing,0;
	end;
	}

}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  29
  • Topics Per Day:  0.01
  • Content Count:  54
  • Reputation:   1
  • Joined:  02/18/18
  • Last Seen:  

On 4/13/2018 at 9:57 AM, AnnieRuru said:

yeah, this script is old school

1 of my server I worked on, I saw players use openkore to cheat this event

 

the openkore detect the announcement 999 then send a packet immediately, and most of the time, cheater wins

I decided to take out this script ever since

 

weird, our script looks entirely different


//====================================================================
// Credits to:
//          acky, for the original script.
//          Vampy, for adding features to the NPC.
//          ~AnnieRuru~, for telling me how infinite loops work.
//          henrikejg, for telling me how to fix infinite loops.
//====================================================================

prontera,155,171,5	script	Stop The Clock::Ev_StopClock	46,{

set $itemid, 15702;

	if (getgmlevel() == 99) goto L_GM;	
	if ($@kc > 0 && @kcid != $@kcid) goto L_eventstarted;
	mes "[Stop The Clock]";
	mes "Hello ^FF0000"+strcharinfo(0)+"^000000, how can I help you?";
	mes "^FF0000[Note] Stop The Clock starts every Tuesday, Thursday and Saturday at 6:00PM server time.^000000";
	menu "^FF0000[Stop The Clock]^000000 information",L_info,"Exit",-;
	close;
	
L_info:
   next;
   mes "[Stop The Clock]";
   mes "^FF0000Stop the clock^000000 is a game where by players need to try to stop the clock as close to 1000 as possible.";
   next;
   mes "[Stop The Clock]";
   mes "The person that stops the clock closest to 1000 wins!";
   mes "^FF0000[Note] You need to stop the clock between 950 and 1000 to win.^000000";
   next;
   mes "[Stop The Clock]";
   mes "In cases where by there's a draw, all the winners will get a prize. For example, if both John and Tom got 997, both of them will get a prize each.";
   mes "Current prize for winning: ^FF0000"+ 1000 + " " +getitemname($itemid)+" ^000000";
   close;
   
L_eventstarted:
			set @kcid,$@kcid;
			setd ".timing_" + .number, $@kc;
			setd ".player_" + .number + "$", strcharinfo(0);
			set .number, .number+1;
			if ($@kc == 1000) {
         announce "Jackpot! "+strcharinfo(0)+" stopped the clock on "+$@kc+".",0,0x00EEFF;
      } else {
			announce ""+strcharinfo(0)+" stopped the clock on "+$@kc+".",0,0x00EEFF;
			}
         end;
	
L_GM:
      mes "[Stop The Clock]";
      mes "Hello Administrator, what would you like to do?";
      mes "Current prize for winning: ^FF0000"+ 1000 + " " + getitemname($itemid)+"^000000";
      menu "Configure Prize",L_configure,"Start Event",-,"Stop Event",L_stop;
      if (.start == 1) goto L_started;
      next;
      mes "[Stop The Clock]";
      mes "Event started.";
      close2;
      
L_startevent:
      set .start, 1;
		announce "[Stop The Clock] is starting in 1 minute!",0;
		initnpctimer;
		end;		
OnTimer30000:
		if (.start == 0) goto L_suddenstop;
		announce "[Stop The Clock] is starting in 30 seconds!",0;
      end;      
OnTimer50000:
		if (.start == 0) goto L_suddenstop;
		announce "[Stop The Clock] is starting in 10 seconds!",0;
		end;
OnTimer55000:
		if (.start == 0) goto L_suddenstop;
		announce "[Stop The Clock] is starting in 5 seconds!",0;
OnTimer60000:
		if (.start == 0) goto L_suddenstop;
      announce "[Stop The Clock] starts now! Stop the clock as close to 1000 as possible! To stop the clock, just click the NPC.",0;
      stopnpctimer;
		set .number, 1;
		set .count, 1000;
		set .winner, 0;
		set $@kc,0;
		set $@kci,0;
		set $@kcid,rand(100000,999999);
		while ($@kc < 1100) {
			set $@kc,$@kc+1;
			set $@kci,$@kci+1;
			if ($@kci == 100 || ($@kci == 10 && $@kc > 600) || ($@kci == 1 && $@kc >= 950 && $@kc < 1050)) {
            if (.start == 0) goto L_suddenstop;
            announce $@kc,0;
				set $@kci,0;
				specialeffect 18;
			}
         sleep 10;
		}
		set $@kc,0;
		set .start, 0;
		set .players, .number+1;
		
OnFinish:
      sleep 1;
      if (.count == 949) goto OnFinish3;
      if (getd(".timing_" + .number) == .count) goto L_winner1;
      set .number, .number-1;
      if (.number != 0) goto OnFinish;
      set .number, 1;
      if (.winner == 1) goto OnFinish3;
      set .count, .count-1;
      
OnFinish2:
      sleep 1;
      if (.count == 949) goto OnFinish3;
      if (getd(".timing_" + .number) == .count) goto L_winner2;
      set .number, .number+1;
      if (.number != .players) goto OnFinish2;
      set .number, .number-1;
      if (.winner == 1) goto OnFinish3;
      set .count, .count-1;
      goto OnFinish;
      
L_winner1:
      if (getd(".timing_" + .number) == 1000) {
      announce ""+getd(".player_" + .number + "$")+" wins! (Prize x2 for stopping exactly on 1000)",0;
      charcommand "#item " + $itemid + " 2000 " + getd(".player_" + .number + "$");
   } else {
      announce ""+getd(".player_" + .number + "$")+" wins!",0;
      charcommand "#item " + $itemid + " 1000 " + getd(".player_" + .number + "$");
      }
      set .number, .number-1;
      set .winner, 1;
      goto OnFinish;
      
L_winner2:
      if (getd(".timing_" + .number) == 1000) {
      announce ""+getd(".player_" + .number + "$")+" wins! (Prize x2 for stopping exactly on 1000)",0;
      charcommand "#item " + $itemid + " 2000 " + getd(".player_" + .number + "$");
   } else {
      announce ""+getd(".player_" + .number + "$")+" wins!",0;
      charcommand "#item " + $itemid + " 1000 " + getd(".player_" + .number + "$");
      }
      set .number, .number+1;
      set .winner, 1;
      goto OnFinish2;
      
OnFinish3:
      sleep 1;
      set .number, .players-1;
      while (.number != 0) {
      set getd(".timing_" + .number), 0;
      set .number, .number-1;
      }
      end;
      
L_started:
      next;
      mes "[Stop The Clock]";
      mes "Event is already running!";
      close;
      
L_configure:
      next;
      mes "[Stop The Clock]";
      mes "Are you sure you want ^FF0000"+ 1000 + " " + getitemname($itemid)+"^000000 to be the prize of the event?";
      menu "Yes",-,"No",L_no;
      next;
      mes "[Stop The Clock]";
      mes "Prize changed to ^FF0000"+ 1000 + " " + getitemname($itemid)+"^000000.";
	announce "Prize changed to "+ 1000 + " " + getitemname($itemid)+".",0;
      next;
      goto L_GM;
      
L_no:
      close;
      
L_stop:
      next;
      if (.start == 1) {
      mes "[Stop The Clock]";
      mes "The event has already started, do you want to stop the event?";
      menu "Yes",-,"No",-;
      
      if (@menu == 1) {
            next;
            set .start, 0;
            mes "[Stop The Clock]";
            mes "Event Stopped";
            next;
            goto L_GM;
      } else {
            next;
            goto L_GM;
            }
      } else {
      mes "[Stop The Clock]";
      mes "The event hasn't started yet!";
      close;
      }

L_suddenstop:
      announce "[Stop The Clock] was stopped by an Administrator.",0;
      end;
      
OnClock1015:
OnClock2215:
      if (gettime(4) == 1 || gettime(4) == 3 || gettime(4) == 5) end;
      goto L_startevent;
}

 

so your script is fixed now  for anti cheat?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

3 hours ago, AOCzxc said:

so your script is fixed now  for anti cheat?

no, this event itself is exploitable,

you shouldn't even host this event

 

--> I decided to take out this script ever since  <---

I'm quite sure its the same with emistry counting game, gmocean disguise event ... etc etc

although I am yet to see players react instantly on these events, well its been a long time since I last work on a live server

Edited by AnnieRuru
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...