Jump to content
  • 0
Kuroyama

Promotional Code Script

Question

Hi Hercules, its me again. Just a little concern about this good script.

I already convert some of the common deprecated warning here into Hercules

but there's one concern I'm encountering with this script.

 

So uhh for example. You claim the code with your main account. After successfully claiming, ofcourse you can't claim it again BUT when you change character or change account. You may now abuse the promo code but entering it all over again and claiming it all over.

 

Here's the script:

promocode.txt

 

Here's the video: 

https://www.youtube.com/watch?v=PY2SrXV-L-I

 

PS: You can't replicate it with 127.0.0.1 IP Address. You need a live IP but somehow  I noticed too that the script is saving incomplete IP address into database like 123.123._ _ _

 

That's all, thank you in advance.

Share this post


Link to post
Share on other sites

8 answers to this question

Recommended Posts

  • 0

https://rathena.org/board/topic/115232-script-doesnt-recognize-spaces/?do=findComment&comment=344440

 

seriously this is getting on my nerve whenever somebody bring this script up

can't everyone just recognize this script is just bug as hell ?

 

and promotion code can always bypass by players no matter how hard you try

block by IP is just plain stupid

better use getitembound instead of getitem so players will realize the reward item is bound to the account only

 

and when the script made as getitembound, means this VERY OLD script is invalid to use in today's script method

 

-------------------------------

 

ok enough being grumpy,

1. the SQL table has to be case-sensitive

2. use varchar

CREATE TABLE IF NOT EXISTS `reward_logs` (
	`account_id` int unsigned NOT NULL default '0',
	`last_ip` varchar(16) NOT NULL,
	`code` VARCHAR(26) NOT NULL,
	`redeem_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`claim` INT NOT NULL,
	PRIMARY KEY (`code`)
) ENGINE = MYISAM;

and I'm not fixing this script

 

better just write a new one with *getitembound

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

A few suggestions in case someone is going to make this script in the future:

 

- redeem log viewer

- 2 types of codes: one that can be used multiple times by different accounts, and one that can be used just once only by one account

- add expiration date to codes, with default date to expire (i.e. 1 month) or undefined (infinite)

- add announce (yes/no) when player redeem code

- add delay to use npc (good to prevent multiple code uses and prevent spam/give chance to slower players)

- better code generation (maybe even saving them on .txt file) being able to chose from random letters and numbers, to anything you want (i.e. mycode2020)

- rewrite everything to getitembound as @AnnieRuru said

- something like this:

-> talk to npc

-> chose code style (random generated or user input)

-> chose code amount (amount of uses that it can be used)

-> chose code type (by account or unique use)

-> (if unique use: we need to add a "group" to the codes, for example: we generate a group of 5 unique codes, they all belong to a group (something to make them unique), so a player can only use one of the 5 codes from THAT group (we need this to make sure that a player alone doesn't use all the codes at once and others player don't have a chance) and the other 4 codes can still be used by other players)

-> chose code reward (itemID - amount)

- no more ideas

 

Edited by evilpuncker

Share this post


Link to post
Share on other sites
  • 0
15 minutes ago, evilpuncker said:

- 2 types of codes: one that can be used multiple times by different accounts, and one that can be used just once only by one account

this one ... I don't understand though

how to detect multiple times by different accounts ?

 

some server out there has a master account system, can register multiple accounts in-game and bind them under a master account in control panel

but this feature is completely custom, and I never seen the code before, so I don't know how to make use of that

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)
2 hours ago, AnnieRuru said:

this one ... I don't understand though

 

for example:

type 1: GM generate code "abc123" and every player in the server can redeem it once per account as long as it is not expired (i.e. you make a post in a social media and need to give only one code and everyone can use it once until it expires)

type 2: GM generate code "abc123" and only the first player that use it will be successful, once he use it the code will expire (i.e. you make a post in a social media and give 5 codes from type 2 and only the 5 person who use it will be able to redeem the item) *okay this need a little trick, I've edited my previous post with the solution*

Edited by evilpuncker

Share this post


Link to post
Share on other sites
  • 0

you mean something like
the first 500 players who redeem this code will get freebies !!

 

this reminds me in real life e-wallet
the first 100,000 customer who use this coupon code will get a discount when do online purchase

terms and conditions apply blah blah

 

15 minutes ago, evilpuncker said:

type 2: GM generate code "abc123" and only the first player that use it will be successful, once he use it the code will expire

once expire ... how ? can't redeem again even for other player ?

isn't this feels stupid ... the code only used once ... if the GM advertise the code, everyone sees the code, but the code only use once .... =/

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)
32 minutes ago, AnnieRuru said:

once expire ... how ? can't redeem again even for other player ?

isn't this feels stupid ... the code only used once ... if the GM advertise the code, everyone sees the code, but the code only use once .... =/

this is to make the item more "special", if everybody can have it its not fun or even balanced :P

 

 

32 minutes ago, AnnieRuru said:

you mean something like
the first 500 players who redeem this code will get freebies !!

yes, the 500 is optional, you can chose between used amount or unlimited

Edited by evilpuncker

Share this post


Link to post
Share on other sites
  • 0
On 10/4/2020 at 9:14 AM, evilpuncker said:

A few suggestions in case someone is going to make this script in the future:

 

- redeem log viewer

- 2 types of codes: one that can be used multiple times by different accounts, and one that can be used just once only by one account

- add expiration date to codes, with default date to expire (i.e. 1 month) or undefined (infinite)

- add announce (yes/no) when player redeem code

- add delay to use npc (good to prevent multiple code uses and prevent spam/give chance to slower players)

- better code generation (maybe even saving them on .txt file) being able to chose from random letters and numbers, to anything you want (i.e. mycode2020)

- rewrite everything to getitembound as @AnnieRuru said

- something like this:

-> talk to npc

-> chose code style (random generated or user input)

-> chose code amount (amount of uses that it can be used)

-> chose code type (by account or unique use)

-> (if unique use: we need to add a "group" to the codes, for example: we generate a group of 5 unique codes, they all belong to a group (something to make them unique), so a player can only use one of the 5 codes from THAT group (we need this to make sure that a player alone doesn't use all the codes at once and others player don't have a chance) and the other 4 codes can still be used by other players)

-> chose code reward (itemID - amount)

- no more ideas

 

Waiting for @AnnieRuru release :meh:

Share this post


Link to post
Share on other sites
  • 0

*peek*

https://gist.github.com/AnnieRuru/f49d2e09c81c31c9c428e088af558f33

around 30% completion, need to sleep

a lot of stuffs not finalize yet, but you can play around first, don't put into live server

 

@Eternity, you are rathena user right ?

this one I made been using hercules specific script command,

*getcalendartime and *pcre_match just not available in rathena, so some features has to scrap,

it won't look the same if these feature taken out

Share this post


Link to post
Share on other sites
  • 0
On 10/6/2020 at 12:10 AM, AnnieRuru said:

*peek*

https://gist.github.com/AnnieRuru/f49d2e09c81c31c9c428e088af558f33

around 30% completion, need to sleep

a lot of stuffs not finalize yet, but you can play around first, don't put into live server

 

@Eternity, you are rathena user right ?

this one I made been using hercules specific script command,

*getcalendartime and *pcre_match just not available in rathena, so some features has to scrap,

it won't look the same if these feature taken out

Is there any way possible madam you can do for rAthena aswell? i would appreciate it thank you!

Share this post


Link to post
Share on other sites
  • 0
On 10/7/2020 at 3:48 PM, Eternity said:

Is there any way possible madam you can do for rAthena aswell? i would appreciate it thank you!

I second this. Think of it as same function but different approach. Thanks annie! ♥

Share this post


Link to post
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.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.