Lucky Pick Event

Let's try this one : 

- script LuckyPick -1,{ OnPCLoginEvent: .aid[getarraysize(.aid)] = getcharid(3); end; OnPCLogoutEvent: for ( .@i = 0; .@i < getarraysize(.aid); .@i++ ) { if ( .aid[.@i] == getcharid(3) ) deletearray .aid[.@i], 1; } end; OnMinute00: .@t++; if ( .@t % 2 ) end; .@i = rand(getarraysize(.aid)); if (attachrid(.aid[.@i])) getitem 501, 1, .aid[.@i]; end;}
@EDIT : Trigger every 2 hours

 
Last edited by a moderator:
hmm ... paskie made a post makes me change my plan to make this topic a top priority in my list

I have made 3 variations of lucky pick event script

http://www.eathena.ws/board/index.php?s=&showtopic=275732&view=findpost&p=1512505 3 years ago

http://rathena.org/board/topic/77364-dynamic-time-lucky-pick-event/?p=173025 last year

http://rathena.org/board/topic/91510-lucky-pick-event/?p=240207 last month

and 4th method now if consider adding paskie's method above

but now I'm going to propose a 5th method ...

write a new script command call *getservermember

I always wanted to write one since years ago but there was array limitation to 127 index all the time ... until last month

http://upaste.me/23e0105643b9c3019

and the script with shuffle algorithm

http://upaste.me/ab41105653011d513

keyworld, feel free to optimized that shuffle algorithm =/

 
hmm ... paskie made a post makes me change my plan to make this topic a top priority in my list

I have made 3 variations of lucky pick event script

http://www.eathena.ws/board/index.php?s=&showtopic=275732&view=findpost&p=1512505 3 years ago

http://rathena.org/board/topic/77364-dynamic-time-lucky-pick-event/?p=173025 last year

http://rathena.org/board/topic/91510-lucky-pick-event/?p=240207 last month

and 4th method now if consider adding paskie's method above

but now I'm going to propose a 5th method ...

write a new script command call *getservermember

I always wanted to write one since years ago but there was array limitation to 127 index all the time ... until last month

http://upaste.me/23e0105643b9c3019

and the script with shuffle algorithm

http://upaste.me/ab41105653011d513

keyworld, feel free to optimized that shuffle algorithm =/
I am trying this http://upaste.me/ab41105653011d513 your lucky-pick-event.

I found bindatcmd "asdf", strnpcinfo(0)+"::Onbbb", 99,100;  this command has no effect(no any error report).

Already add your source getservermember 

 
Onbbb:...... if ( getgmlevel() < 60 && checkvending() != 2 ) {this script will search on all online account ID, but only runs on players that is not GM60 and not autotraders
you can try dual-client

login 1 account with GM99 to test, then login another account with normal player account (no GM)

it will always give the prize to the normal player,

because GMs are not supposed to win this kind of event, players will complain GMs are cheating

 
Last edited by a moderator:
Onbbb:...... if ( getgmlevel() < 60 && checkvending() != 2 ) {this script will search on all online account ID, but only runs on players that is not GM60 and not autotraders
you can try dual-client

login 1 account with GM99 to test, then login another account with normal player account (no GM)

it will always give the prize to the normal player,

because GMs are not supposed to win this kind of event, players will complain GMs are cheating
Oh, it no effect in my test server.

It works fine in Public Server.
default_tongue.png


And other question, can I set this run every xx minutes?

OnMinute00:Onbbb:// while ( .@j++ < 100 ) { // ran a test with 100 times 

I add a OnMinute00:  in this line, but it not run. 

 
how its not working ?
default_hmm.gif


OnMinute18: announce "runs without attachrid", bc_all;Onbbb:// while ( .@j++ < 100 ) { // ran a test with 100 times getservermember 2; callfunc "shuffle", 0, $@servermembercount -1, .@r; for ( .@i = 0; .@i < $@servermembercount; .@i++ ) { attachrid $@servermemberaid[ .@r[.@i] ]; if ( getgmlevel() < 60 && checkvending() != 2 ) { announce "Winner is "+ strcharinfo(0), bc_all; getitem 501, 1; break; } }// } end;
screenHercules004.jpg
PS: http://herc.ws/board/topic/4455-capped-aspd-mapflag/

 
Last edited by a moderator:
how its not working ?
default_hmm.gif


OnMinute18: announce "runs without attachrid", bc_all;Onbbb:// while ( .@j++ < 100 ) { // ran a test with 100 times getservermember 2; callfunc "shuffle", 0, $@servermembercount -1, .@r; for ( .@i = 0; .@i < $@servermembercount; .@i++ ) { attachrid $@servermemberaid[ .@r[.@i] ]; if ( getgmlevel() < 60 && checkvending() != 2 ) { announce "Winner is "+ strcharinfo(0), bc_all; getitem 501, 1; break; } }// } end;
attachicon.gif
screenHercules004.jpg
PS: http://herc.ws/board/topic/4455-capped-aspd-mapflag/

e, I seem dizzy.
default_happy.png
  It's OK~

 
hmm ... paskie made a post makes me change my plan to make this topic a top priority in my list

I have made 3 variations of lucky pick event script

http://www.eathena.ws/board/index.php?s=&showtopic=275732&view=findpost&p=1512505 3 years ago

http://rathena.org/board/topic/77364-dynamic-time-lucky-pick-event/?p=173025 last year

http://rathena.org/board/topic/91510-lucky-pick-event/?p=240207 last month

and 4th method now if consider adding paskie's method above

but now I'm going to propose a 5th method ...

write a new script command call *getservermember

I always wanted to write one since years ago but there was array limitation to 127 index all the time ... until last month

http://upaste.me/23e0105643b9c3019

and the script with shuffle algorithm

http://upaste.me/ab41105653011d513

keyworld, feel free to optimized that shuffle algorithm =/
this one doesnt work , tried them all 

this is the error that shows in my console :

[Error]: script error in file '(DIRECT INPUT)' line 32 column 2

parse_line: expect command, missing function name or calling undeclared function

29: bindatcmd "asdf", strnpcinfo(0)+"::Onbbb", 99,100;

30: end;

31: Onooo:

* 32: getservermember 0;

~~~~~~~~^

33: for ( .@i = 0; .@i < $@servermembercount; .@i++ )

34: dispbottom $@servermembername$[.@i];

35: end;
 
hmm ... paskie made a post makes me change my plan to make this topic a top priority in my list

I have made 3 variations of lucky pick event script

http://www.eathena.ws/board/index.php?s=&showtopic=275732&view=findpost&p=1512505 3 years ago

http://rathena.org/board/topic/77364-dynamic-time-lucky-pick-event/?p=173025 last year

http://rathena.org/board/topic/91510-lucky-pick-event/?p=240207 last month

and 4th method now if consider adding paskie's method above

but now I'm going to propose a 5th method ...

write a new script command call *getservermember

I always wanted to write one since years ago but there was array limitation to 127 index all the time ... until last month

http://upaste.me/23e0105643b9c3019

and the script with shuffle algorithm

http://upaste.me/ab41105653011d513

keyworld, feel free to optimized that shuffle algorithm =/
this one doesnt work , tried them all 

this is the error that shows in my console :

[Error]: script error in file '(DIRECT INPUT)' line 32 column 2

parse_line: expect command, missing function name or calling undeclared function

29: bindatcmd "asdf", strnpcinfo(0)+"::Onbbb", 99,100;

30: end;

31: Onooo:

* 32: getservermember 0;

~~~~~~~~^

33: for ( .@i = 0; .@i < $@servermembercount; .@i++ )

34: dispbottom $@servermembername$[.@i];

35: end;

apply the diff first

 
Last edited by a moderator:
hmm ... paskie made a post makes me change my plan to make this topic a top priority in my list

I have made 3 variations of lucky pick event script

http://www.eathena.ws/board/index.php?s=&showtopic=275732&view=findpost&p=1512505 3 years ago

http://rathena.org/board/topic/77364-dynamic-time-lucky-pick-event/?p=173025 last year

http://rathena.org/board/topic/91510-lucky-pick-event/?p=240207 last month

and 4th method now if consider adding paskie's method above

but now I'm going to propose a 5th method ...

write a new script command call *getservermember

I always wanted to write one since years ago but there was array limitation to 127 index all the time ... until last month

http://upaste.me/23e0105643b9c3019

and the script with shuffle algorithm

http://upaste.me/ab41105653011d513

keyworld, feel free to optimized that shuffle algorithm =/
this one doesnt work , tried them all 

this is the error that shows in my console :

[Error]: script error in file '(DIRECT INPUT)' line 32 column 2

parse_line: expect command, missing function name or calling undeclared function

29: bindatcmd "asdf", strnpcinfo(0)+"::Onbbb", 99,100;

30: end;

31: Onooo:

* 32: getservermember 0;

~~~~~~~~^

33: for ( .@i = 0; .@i < $@servermembercount; .@i++ )

34: dispbottom $@servermembername$[.@i];

35: end;

apply the diff first
how noob i am , thank you <3

 
Back
Top