Jump to content
  • 0

Who's Online Event (random pick of online player)


cassie24

Question


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  60
  • Reputation:   0
  • Joined:  04/25/14
  • Last Seen:  

Can I request for a script where a random online player could be generated and be given a reward? It must be activated by a GM and not automated. Pls help TY

Link to comment
Share on other sites

10 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  89
  • Reputation:   7
  • Joined:  02/27/12
  • Last Seen:  

As per the script that EL Dragon posted, here's a GM activated version.

prontera,100,100,4	script	Who's Online Event	99,{

if (getgroupid() == 99) goto Event_Menu;
mes "[Who's Online Event]";
mes "Only GM's are allowed to use this NPC.";
close;

Event_Menu:
	set .@invokeid,getcharid(3);
	mes "[Who's Online Event]";
	mes "Enable event?";
	menu "Yes",-,"No",Event_End;
	
	while(1){
	query_sql "select account_id from `char` where online = 1 order by rand() limit 1", .@aid;
	attachrid .@aid;
	if( CheckVending() ){
		DetachRID();
		continue;
	}
	announce strcharinfo(0) +" won 500 Cash in Who's Online Event", 0,0x00FF00;
	set #CASHPOINTS,#CASHPOINTS+500;
	dispbottom "You got 500 cash point";
	break;
	}
	attachrid(.@invokeID);
	close;

Event_End:
close;
}
Edited by Jyabil
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  86
  • Topics Per Day:  0.02
  • Content Count:  591
  • Reputation:   146
  • Joined:  06/19/12
  • Last Seen:  


aw fail sorry its atomatic xD

Edited by EL Dragon
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  60
  • Reputation:   0
  • Joined:  04/25/14
  • Last Seen:  

Its okay, can I see the script again, sir?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  86
  • Topics Per Day:  0.02
  • Content Count:  591
  • Reputation:   146
  • Joined:  06/19/12
  • Last Seen:  

sorry it was automatic script

//http://rathena.org/board/topic/53877-lucky-pick-event/
//emistry script

- script AutoFunEvent -1,{
OnInit:
OnClock0000:
set .LuckyTime,rand(24);
OnMinute00:
if( gettime(3) == .LuckyTime ){
set .DelayMin,rand(60);
sleep ( .DelayMin * 60000 );
while(1){
  query_sql "select account_id from `char` where online = 1 order by rand() limit 1", .@aid;
  attachrid .@aid;
  if( CheckVending() ){
   DetachRID();
   continue;
   }
  announce strcharinfo(0) +" won 500 Cash in Lucky Pick Event", 0,0x00FF00;
  set #CASHPOINTS,#CASHPOINTS+500;
  dispbottom "you got 500 cash point";
  break;
}
}
end;
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  60
  • Reputation:   0
  • Joined:  04/25/14
  • Last Seen:  

Thanks El Dragon and Jyabil, but how can I set the prize to item ID though? 


And also announce a line before actually announcing who's the winner?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  89
  • Reputation:   7
  • Joined:  02/27/12
  • Last Seen:  

Thanks El Dragon and Jyabil, but how can I set the prize to item ID though? 

And also announce a line before actually announcing who's the winner?

 

If you want the prize to be items instead of cash points, remove

set #CASHPOINTS,#CASHPOINTS+500;

and change it to

getitem 501,1; // In example, this code will give you 1 pc of Red Potion

To add announcement, add these before the announcing of the winner

announce "Your Message Here",0,0x00FF00;
sleep 1000; // 1 second delay before announcing the winner, configure it to your liking
Edited by Jyabil
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  60
  • Reputation:   0
  • Joined:  04/25/14
  • Last Seen:  

Jyabil thanks but I figured it out already earlier, just based it to some existing scripts and it worked! Thanks very much Jyabil!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  54
  • Reputation:   1
  • Joined:  08/28/14
  • Last Seen:  

 

sorry it was automatic script

//http://rathena.org/board/topic/53877-lucky-pick-event/
//emistry script

- script AutoFunEvent -1,{
OnInit:
OnClock0000:
set .LuckyTime,rand(24);
OnMinute00:
if( gettime(3) == .LuckyTime ){
set .DelayMin,rand(60);
sleep ( .DelayMin * 60000 );
while(1){
  query_sql "select account_id from `char` where online = 1 order by rand() limit 1", .@aid;
  attachrid .@aid;
  if( CheckVending() ){
   DetachRID();
   continue;
   }
  announce strcharinfo(0) +" won 500 Cash in Lucky Pick Event", 0,0x00FF00;
  set #CASHPOINTS,#CASHPOINTS+500;
  dispbottom "you got 500 cash point";
  break;
}
}
end;
}

If im not mistaken this is every 1 hour?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  109
  • Reputation:   2
  • Joined:  06/04/13
  • Last Seen:  

Can someon give ascript of this where it is automated in a certain time. like it will be picking 1 lucky player every 7pm

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  30
  • Reputation:   0
  • Joined:  08/08/13
  • Last Seen:  

Sir how to add time for example i want it to set 4 times a day if i would like to pick 12PM 5PM 9PM
 

it this gonna be like this?

 

OnInit:

OnClock1200:

OnClock1700:

OnClock2100:

set .LuckyTime,rand(24);
OnMinute00:
if( gettime(3) == .LuckyTime ){

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...