Jump to content
  • 0

Dynamic Time Lucky Pick Event


zein

Question


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  34
  • Reputation:   4
  • Joined:  03/16/12
  • Last Seen:  

How to change the dynamic time?

I want to make the script run minimum every 1 hours + randomly minute.

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

- script AutoFunEvent -1,{
OnInit:
OnClock0000:
set .LuckyTime,rand(24);
OnMinute60:
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;
}

Thanks :)

Edited by zenz90
Link to comment
Share on other sites

19 answers to this question

Recommended Posts

  • 1

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

this script sux big time

use mine

http://rathena.org/board/topic/72927-the-prize-is-not-given-to-players/#entry149317

update this script

-	script	AutoFunEvent	-1,{
OnInit:
while (1) {
	freeloop 1;
	.@rand = rand(2000000000);
	.@count = 0;
	while ( getusers(1) > .@count ) {
		.@nb = query_sql("select account_id from `char` where online = 1 order by rand("+ .@rand +") limit 128 offset "+ .@count, .@aid );
		.@i = 0;
		while ( .@i < .@nb ) {
			if ( attachrid(.@aid[.@i]) ) {
				if ( getgmlevel() < 60 && !checkvending() ) { // only normal players and non-vending players
					announce strcharinfo(0) +" won 500 Cash in Lucky Pick Event", 0,0x00FF00;
					#cashpoints = #cashpoints + 500;
					dispbottom "you got 500 cash point";
					break;
				}
			}
			.@i++;
		}
		if ( .@i < .@nb )
			break;
		.@count += 128;
	}
	freeloop 0;
	sleep 3600000 + rand(3600000); // 1 hour + random minutes within 1 hour
}
end;
}

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.05
  • Content Count:  478
  • Reputation:   14
  • Joined:  11/30/17
  • Last Seen:  

Sorry for a noob question i search everywhere about this script and i found out only modifications i tried the original link but not found by emistry i know how to put NPC's but this is an automated event and npc is not needed (i dont know im still new here)so how can i run/execute this? where to put? thank you

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

On 12/23/2019 at 1:58 AM, kalabasa said:

Sorry for a noob question i search everywhere about this script and i found out only modifications i tried the original link but not found by emistry i know how to put NPC's but this is an automated event and npc is not needed (i dont know im still new here)so how can i run/execute this? where to put? thank you

Just load it like you would any other NPC. Also you shouldn't necro really old topics like this there is more than enough information out there about loading in NPCs.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.05
  • Content Count:  478
  • Reputation:   14
  • Joined:  11/30/17
  • Last Seen:  

On 12/28/2019 at 12:02 PM, Skorm said:

Just load it like you would any other NPC. Also you shouldn't necro really old topics like this there is more than enough information out there about loading in NPCs.

i am sorry for you thinking that way i was currently getting useful scripts here to be tested soon and im still new in here sorry again for misunderstood

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  398
  • Reputation:   246
  • Joined:  07/04/19
  • Last Seen:  

2 hours ago, kalabasa said:

i am sorry for you thinking that way i was currently getting useful scripts here to be tested soon and im still new in here sorry again for misunderstood

here
edit
onlock and onminute
 

prontera,150,150,4	script	Event	998,{

OnInit:
OnClock0000:
set .LuckyTime,rand(24);
OnMinute60:
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:  162
  • Topics Per Day:  0.04
  • Content Count:  313
  • Reputation:   1
  • Joined:  01/22/12
  • Last Seen:  

Also need this (:

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

OnMinute00:
sleep ( rand(60) * 1000 );

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  34
  • Reputation:   4
  • Joined:  03/16/12
  • Last Seen:  

Thanks for reply Emistry !

so the script edited like this ?

//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 ( rand(60) * 1000 );
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;
}

Edited by zenz90
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Yes it is.

btw you can remove

set .DelayMin,rand(60);

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  34
  • Reputation:   4
  • Joined:  03/16/12
  • Last Seen:  

@AnnieRuru

is that script works on 3CeAM ?

btw thanks for reply :D

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

@AnnieRuru

is that script works on 3CeAM ?

btw thanks for reply :D

* Imitate the voice of AnnieRuru *

No it doesn't ! (lol)

It works only on rAthena

Edited by Capuche
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  83
  • Reputation:   0
  • Joined:  06/02/12
  • Last Seen:  

Hi, how can we change this into items instead of cashpoints?

thanks /no1

Edited by jigsgfx
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

change

set #CASHPOINTS,#CASHPOINTS+500;

to

getitem 512,1000;

refer getitem or getitem2

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  83
  • Reputation:   0
  • Joined:  06/02/12
  • Last Seen:  

change

set #CASHPOINTS,#CASHPOINTS+500;

to

getitem 512,1000;

refer getitem or getitem2

thanks emistry how about the one Annie did?

ill change this

 #cashpoints = #cashpoints + 500;

to this

getitem 512,1000;

??

and can i use 2 same lucky pick script at the same time with different item reward set on it?

also does afk players are excluded meaning afk dont have a chance to pick by the script and get rewards?

Edited by jigsgfx
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  34
  • Reputation:   4
  • Joined:  03/16/12
  • Last Seen:  

@Emistry

The dynamic time doesn't work, it still run every 12-24 hour

I want make it to one hour + randomly minute.

any suggestion?

Thanks,

//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 ( rand(60) * 1000 );
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:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

remove these if you want it to work every hours.


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

Link to comment
Share on other sites


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

sleep 3600000 + rand(3600000); // 1 hour + random minutes within 1 hour

I thought mine already comply your request ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  280
  • Topics Per Day:  0.06
  • Content Count:  841
  • Reputation:   17
  • Joined:  04/16/12
  • Last Seen:  

sleep 3600000 + rand(3600000); // 1 hour + random minutes within 1 hour
I thought mine already comply your request ?

 

If I want it to be every 6 hours do I need to multiply 3600000 to 6 ? and remove + rand(3600000) ? Thanks!

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

Yes

sleep 3600000 * 6; // 1 Hour in Milliseconds * 6
21600000 / 1000 = 21600 //seconds

21600 / 60 = 360 //Minutes

360 / 60 = 6 //Hours

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