shatowolf Posted September 26, 2013 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 259 Reputation: 35 Joined: 11/19/11 Last Seen: April 9 Share Posted September 26, 2013 Hi, bug report. Sample you generate a code : welcome123 them if player get it already, then someone "player" type : WELCOME123 players can spam it.\ or Welcome123 - uppercase W it will spam code. Did you put these queries? DROP TABLE IF EXISTS `reward_codes`; DROP TABLE IF EXISTS `reward_logs`; CREATE TABLE IF NOT EXISTS `reward_codes` ( `promo` VARCHAR(26) NOT NULL DEFAULT '', `nameid` INT(11) UNSIGNED NOT NULL DEFAULT '0', `item_name` VARCHAR(50) NOT NULL DEFAULT '', `amount` SMALLINT(6) UNSIGNED NOT NULL DEFAULT '0', `time_created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', `limit` INT(10) UNSIGNED NOT NULL DEFAULT '0', `pool` INT(10) UNSIGNED NOT NULL DEFAULT '0', PRIMARY KEY (`promo`) ) ENGINE = MYISAM; CREATE TABLE `reward_logs` ( `code` VARCHAR( 26 ) NOT NULL DEFAULT '', `account_id` int(11) unsigned NOT NULL default '0', `last_ip` BINARY( 9 ) NOT NULL DEFAULT '', `name` VARCHAR( 26 ) NOT NULL DEFAULT '', `redeem_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', `claim` INT( 10 ) NOT NULL default '0', PRIMARY KEY (`code`) ) ENGINE = MYISAM; Yes. still player's can spam it. with upper case letter. Quote Link to comment Share on other sites More sharing options...
Lil Troll Posted September 26, 2013 Group: Members Topic Count: 38 Topics Per Day: 0.01 Content Count: 276 Reputation: 24 Joined: 07/06/13 Last Seen: April 19, 2014 Author Share Posted September 26, 2013 (edited) Hi, bug report. Sample you generate a code : welcome123 them if player get it already, then someone "player" type : WELCOME123 players can spam it.\ or Welcome123 - uppercase W it will spam code. Did you put these queries? DROP TABLE IF EXISTS `reward_codes`; DROP TABLE IF EXISTS `reward_logs`; CREATE TABLE IF NOT EXISTS `reward_codes` ( `promo` VARCHAR(26) NOT NULL DEFAULT '', `nameid` INT(11) UNSIGNED NOT NULL DEFAULT '0', `item_name` VARCHAR(50) NOT NULL DEFAULT '', `amount` SMALLINT(6) UNSIGNED NOT NULL DEFAULT '0', `time_created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', `limit` INT(10) UNSIGNED NOT NULL DEFAULT '0', `pool` INT(10) UNSIGNED NOT NULL DEFAULT '0', PRIMARY KEY (`promo`) ) ENGINE = MYISAM; CREATE TABLE `reward_logs` ( `code` VARCHAR( 26 ) NOT NULL DEFAULT '', `account_id` int(11) unsigned NOT NULL default '0', `last_ip` BINARY( 9 ) NOT NULL DEFAULT '', `name` VARCHAR( 26 ) NOT NULL DEFAULT '', `redeem_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', `claim` INT( 10 ) NOT NULL default '0', PRIMARY KEY (`code`) ) ENGINE = MYISAM; Yes. still player's can spam it. with upper case letter. I upload a quick fix. Thanks for the report, shatowolf and uDe @ude found no close button bug for you, I replaced end with close, in my current svn end is working fine. from this: announce "No exisiting codes.",bc_self; end; to this: announce "No exisiting codes.",bc_self; close; @shatowolf i add small caps letters, let see if this fix will work, please do reply if you see more of them. For random code generation, from this: setarray .@s$,"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","1","2","3","4","5","6","7","8","9","0"; to this: setarray .@s$[0],"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","1","2","3","4","5","6","7","8","9","0"; Or if both of you guys referring to promo code pool count? (Maximum claim limit) Change this: setarray $@ClaimLimit[0],1,2,3,4,5,6,7,8,9,10; To: setarray $@ClaimLimit[0],1; or set $@ClaimLimit,1; And in-game if you are manually creating a code. Set the max claim limit to 1(means the pool count of the code will be 1, after 1 player get a code, it turns to 0 and then the code cannot be claimed again.) See pic Below: Currently i`m working on a big update for this script but i don't yet have spare time to do the project. I added random code generation length detection, from 5-15 supported chars in this fix. I used hard coded random code generator, not the one a using now, because some might caught an errors. setarray $@length,5,15; // <MIN>,<MAX> LENGTH CHECK // 5 Recommended Minimum due to not recognizing 1234 from garbage deletion. // 15 maximum characters supported in random code generation. Edited September 27, 2013 by Lil Troll Quote Link to comment Share on other sites More sharing options...
Drakkus Posted September 27, 2013 Group: Members Topic Count: 39 Topics Per Day: 0.01 Content Count: 386 Reputation: 15 Joined: 11/17/11 Last Seen: September 13, 2024 Share Posted September 27, 2013 When will be the final release of this? including the WIP features. Quote Link to comment Share on other sites More sharing options...
shatowolf Posted September 27, 2013 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 259 Reputation: 35 Joined: 11/19/11 Last Seen: April 9 Share Posted September 27, 2013 (edited) Good day Lil Troll, Still it can spam using caps lock. if you caps lock the code it can spam. we are using the latest 1.2.1 Edited September 27, 2013 by shatowolf 1 Quote Link to comment Share on other sites More sharing options...
uDe Posted September 27, 2013 Group: Members Topic Count: 43 Topics Per Day: 0.01 Content Count: 400 Reputation: 5 Joined: 12/05/11 Last Seen: September 27, 2015 Share Posted September 27, 2013 Good day Lil Troll, Still it can spam using caps lock. if you caps lock the code it can spam. Ya.. Me too. Quote Link to comment Share on other sites More sharing options...
Lil Troll Posted September 27, 2013 Group: Members Topic Count: 38 Topics Per Day: 0.01 Content Count: 276 Reputation: 24 Joined: 07/06/13 Last Seen: April 19, 2014 Author Share Posted September 27, 2013 Thanks guys for stating errors, got to look over it. I think ima re-write the whole sql part. Give me a bit over here. Quote Link to comment Share on other sites More sharing options...
shatowolf Posted September 27, 2013 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 259 Reputation: 35 Joined: 11/19/11 Last Seen: April 9 Share Posted September 27, 2013 Thanks guys for stating errors, got to look over it. I think ima re-write the whole sql part. Give me a bit over here. Sure mate. Quote Link to comment Share on other sites More sharing options...
Lil Troll Posted October 1, 2013 Group: Members Topic Count: 38 Topics Per Day: 0.01 Content Count: 276 Reputation: 24 Joined: 07/06/13 Last Seen: April 19, 2014 Author Share Posted October 1, 2013 Thanks guys for stating errors, got to look over it. I think ima re-write the whole sql part. Give me a bit over here. Sure mate. Updated to 1.2.2 actually guys, I do not know what causing you the bug, but it was working fine on me, I think the bug is because of SQL Administrative issues or using older SVN's. Quote Link to comment Share on other sites More sharing options...
shatowolf Posted October 1, 2013 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 259 Reputation: 35 Joined: 11/19/11 Last Seen: April 9 Share Posted October 1, 2013 Hi Lil Troll, Create a code like this sir, welcome123 and claim it using this Welcome123 uppercase "W" it will trigger the spam. you can get unlimited item using the code Welcome123 uppercase "W" Thanks, Quote Link to comment Share on other sites More sharing options...
Lil Troll Posted October 1, 2013 Group: Members Topic Count: 38 Topics Per Day: 0.01 Content Count: 276 Reputation: 24 Joined: 07/06/13 Last Seen: April 19, 2014 Author Share Posted October 1, 2013 Its working fine on me, me and my homie also tried connecting to Hamachi to test the script and the video shows the result, do errors appear on your map server? Quote Link to comment Share on other sites More sharing options...
uDe Posted October 2, 2013 Group: Members Topic Count: 43 Topics Per Day: 0.01 Content Count: 400 Reputation: 5 Joined: 12/05/11 Last Seen: September 27, 2015 Share Posted October 2, 2013 Hi Lil Troll, Create a code like this sir, welcome123 and claim it using this Welcome123 uppercase "W" it will trigger the spam. you can get unlimited item using the code Welcome123 uppercase "W" Thanks, Or can be abuse with WELCOME123. Try it. Quote Link to comment Share on other sites More sharing options...
Lil Troll Posted October 2, 2013 Group: Members Topic Count: 38 Topics Per Day: 0.01 Content Count: 276 Reputation: 24 Joined: 07/06/13 Last Seen: April 19, 2014 Author Share Posted October 2, 2013 (edited) Hi Lil Troll, Create a code like this sir, welcome123 and claim it using this Welcome123 uppercase "W" it will trigger the spam. you can get unlimited item using the code Welcome123 uppercase "W" Thanks, Or can be abuse with WELCOME123. Try it. Using input string is case sensitive. Sorry guys it took long, because I cant get what you both want to say to me. I`m not really good in English. Now this is the fix: input .@pcode$; set .@pc$,strtoupper(.@pcode$); All inputted codes will be set to uppercase. Also all random codes is generated in upper case. Updated to new version. Please tell me guys if you found new bugs/errors, so that my next release will be much stable. (Includes mailing of codes and referral system.) Edited October 2, 2013 by Lil Troll Quote Link to comment Share on other sites More sharing options...
shatowolf Posted October 4, 2013 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 259 Reputation: 35 Joined: 11/19/11 Last Seen: April 9 Share Posted October 4, 2013 As of now, i don't find any bug, it's working fine now, i'll update once i find bug on this. thanks man. Quote Link to comment Share on other sites More sharing options...
orange Posted November 7, 2013 Group: Members Topic Count: 39 Topics Per Day: 0.01 Content Count: 175 Reputation: 7 Joined: 09/13/12 Last Seen: May 14, 2021 Share Posted November 7, 2013 @Lil Troll u r doing a great job!! I feel u r improving a lot !!! kee up the progress! i am sure if u continue this way u will get a user award too !!! Quote Link to comment Share on other sites More sharing options...
leondedios Posted January 6, 2014 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 12 Reputation: 0 Joined: 10/02/13 Last Seen: September 23, 2018 Share Posted January 6, 2014 help please I have problems I have these errors, any solution? : DB error - Unknown column 'codes' in 'field list'[Debug]: at script.c:14834 - SELECT `codes`,`redeem_time` FROM `reward_logs` ORDER BY pool ASC LIMIT 25[Debug]: Source (NPC): LilTrollPCodes (invisible/not on a map)[Debug]: script debug : 0 110015856 : reward_logs garbage has been deleted. Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted January 7, 2014 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted January 7, 2014 (edited) http://dba.stackexchange.com/questions/15250/how-to-do-a-case-sensitive-search-in-where-clause by default, the table creation use charset = latin1; means it couldn't do a case-sensitive search if you want to do a case-sensitive in a query, use BINARY select * from `char` where name = binary('AnnieRuru');however using BINARY might have performance hit if it is a big tableso its more recommend to convert your sql table to collate with latin1_general_cs let's say this is a sample table create table testtest ( id int(11) primary key auto_increment, name varchar(23) )engine = innodb;do an alter table syntax alter table testtest modify column name varchar(23) collate latin1_general_cs;or just put it into the table creation create table testtest ( id int(11) primary key auto_increment, name varchar(23) )engine = innodb default charset = latin1 collate latin1_general_cs; @leondedios set .@garbage,query_sql("SELECT `codes`,`redeem_time` FROM `reward_logs` ORDER BY pool ASC LIMIT 25",.@code$); for(set .@i,1; .@i <= .@garbage; set .@i,.@i++) { query_sql "DELETE FROM `reward_logs` WHERE `codes` = '" + escape_sql(.@code$[0]) + "'"; // Number 1 row will be deleted. query_sql "DELETE FROM `reward_logs` WHERE `codes` = '" + escape_sql(.@code$[.@i]) + ""; // Numbers from 2-25 rows will be deleted. }change into set .@garbage,query_sql("SELECT `code`,`redeem_time` FROM `reward_logs` ORDER BY pool ASC LIMIT 25",.@code$); for(set .@i,1; .@i <= .@garbage; set .@i,.@i++) { query_sql "DELETE FROM `reward_logs` WHERE `code` = '" + escape_sql(.@code$[0]) + "'"; // Number 1 row will be deleted. query_sql "DELETE FROM `reward_logs` WHERE `code` = '" + escape_sql(.@code$[.@i]) + ""; // Numbers from 2-25 rows will be deleted. } Edited January 7, 2014 by AnnieRuru Quote Link to comment Share on other sites More sharing options...
GM Henry Posted January 28, 2017 Group: Members Topic Count: 7 Topics Per Day: 0.00 Content Count: 44 Reputation: 9 Joined: 03/07/13 Last Seen: April 12, 2023 Share Posted January 28, 2017 : DB error - Data too long for column 'last_ip' at row 1 [Debug]: at c:\#\src\map\script.c:16173 - INSERT INTO `reward_logs` (`account_id`,`last_ip`,`code`,`redeem_time`,`claim`) VALUES ('2000001','#','ROOSTER',NOW(),'1') [Debug]: Source (NPC): LilTrollPCodes (invisible/not on a map) Gives this error every time i claim an code. Seems its not getting the last ip data. Any idea how to solve this. Quote Link to comment Share on other sites More sharing options...
Imbecile Posted October 17, 2017 Group: Members Topic Count: 10 Topics Per Day: 0.00 Content Count: 52 Reputation: 1 Joined: 04/14/17 Last Seen: February 9 Share Posted October 17, 2017 Hi sir! I'm using your script and it's awesome! But i want to make a npc for it. But if i input the atcommand "@claim" in the script, it says @claim is unknown command. How do i fix this? Thanks Quote Link to comment Share on other sites More sharing options...
Leic Posted April 2, 2018 Group: Members Topic Count: 18 Topics Per Day: 0.01 Content Count: 48 Reputation: 0 Joined: 02/27/18 Last Seen: May 3, 2018 Share Posted April 2, 2018 although it works. it still has some bugs. 1. when you type "test111" and type "test111 " "test111 " with spaces it doesn't recognize the code as already received. Quote Link to comment Share on other sites More sharing options...
AinsLord Posted October 21, 2018 Group: Members Topic Count: 261 Topics Per Day: 0.08 Content Count: 758 Reputation: 20 Joined: 11/21/15 Last Seen: April 6 Share Posted October 21, 2018 (edited) it can still claim multiple times by one account and its not bounded Edited October 21, 2018 by AinsLord Quote Link to comment Share on other sites More sharing options...
PsyOps Posted December 10, 2018 Group: Members Topic Count: 6 Topics Per Day: 0.00 Content Count: 150 Reputation: 12 Joined: 12/03/18 Last Seen: 8 hours ago Share Posted December 10, 2018 i think that it is still not updated. I tried and i experienced case sensitive issues with same account can still claim the prize. If i switch to one account and i go for another account with the same IP, it can still claim. Quote Link to comment Share on other sites More sharing options...
xJhay Posted September 2, 2020 Group: Members Topic Count: 14 Topics Per Day: 0.00 Content Count: 38 Reputation: 0 Joined: 11/22/16 Last Seen: May 1, 2021 Share Posted September 2, 2020 On 12/10/2018 at 6:34 PM, Dev G Inc said: i think that it is still not updated. I tried and i experienced case sensitive issues with same account can still claim the prize. If i switch to one account and i go for another account with the same IP, it can still claim. Experiencing this too. Any update for this wonderful script? Quote Link to comment Share on other sites More sharing options...
PsyOps Posted September 3, 2020 Group: Members Topic Count: 6 Topics Per Day: 0.00 Content Count: 150 Reputation: 12 Joined: 12/03/18 Last Seen: 8 hours ago Share Posted September 3, 2020 21 hours ago, xJhay said: Experiencing this too. Any update for this wonderful script? Probably there is actually. Just need to refine it really Quote Link to comment Share on other sites More sharing options...
xJhay Posted September 4, 2020 Group: Members Topic Count: 14 Topics Per Day: 0.00 Content Count: 38 Reputation: 0 Joined: 11/22/16 Last Seen: May 1, 2021 Share Posted September 4, 2020 If you don't mind, could you help us to improve this script? Like I mean this is really a good script and very useful but somehow, players can abuse it. Quote Link to comment Share on other sites More sharing options...
xerxesbreak Posted January 12, 2021 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 5 Reputation: 0 Joined: 10/06/20 Last Seen: February 13, 2023 Share Posted January 12, 2021 if(query_sql("SELECT `claim` FROM `reward_logs` WHERE `code` = '" + escape_sql(.@pc$) + "'",.@claim)) { set .@claim,0; query_sql("UPDATE `reward_logs` SET `claim` = '"+1+"' WHERE `code` = '" + escape_sql(.@pc$) + "'"); } else { query_sql("INSERT INTO `reward_logs` (`account_id`,`last_ip`,`code`,`redeem_time`,`claim`) VALUES ('"+getcharid(3)+"','"+getcharip(strcharinfo(0))+"','"+escape_sql(.@pc$)+"',NOW(),'"+1+"')"); } the problem lies in this line. The reason why everyone can spam it is because it doesn't put any data after the first one so the only that wouldn't be able to spam it is the 1st ip to claim it, if anyone can fix it it would be really great. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.