Lugia Posted June 2, 2013 Posted June 2, 2013 I am looking for freebies script which : 1. Check Mac IP Address to avoid duplicate use of the npc by creating a new account again and again. 2. Which give +7 Equipment 3. If the mac address is already used, s/he can't use the npc again. Quote
Mootie Posted June 2, 2013 Posted June 2, 2013 something like this? prontera,110,56,3 script Freebies Coin 962,{ function get_MAC_variable; function set_MAC_variable; query_sql "SELECT last_mac FROM login WHERE account_id="+ getcharid(3), @my_MAC$; if (get_MAC_variable("$#lockout") > 0) { mes "I already gave a prize to someone from your MAC address."; } else { if (!checkweight(909,1)) { mes "You are overweight or carrying too many items."; } else { getitem 677,5; // Jellopy, put how many as you want set_MAC_variable "$#lockout", 1; mes "Here is your coin!!"; } } close; function get_MAC_variable { // $#variable = MAC variable set .@varname$, strtolower(getarg(0, "null")); set .@is_string, (charat(.@varname$, getstrlen(.@varname$)-1) == "$"); if (query_sql("SELECT `value` FROM `mac2_reg_value` WHERE `mac`='"+ @my_MAC$ +"' AND `str`='"+ escape_sql(.@varname$) +"'", .@value$)) { return (.@is_string ? .@value$ : atoi(.@value$)); } else { return (.@is_string ? "" : 0); } } function set_MAC_variable { set .@varname$, strtolower(getarg(0, "null")); set .@is_string, (charat(.@varname$, getstrlen(.@varname$)-1) == "$"); set .@value$, getarg(1, (.@is_string ? "" : 0)); // trim the trailing "$" so name validation is easier if (.@is_string) set .@varname$, substr(.@varname$, 0,getstrlen(.@varname$) -1); // validate variable name if (.@varname$ == "null") { debugmes "set_MAC_variable - missing variable name"; end; } else if (getstrlen(.@varname$) < 3 || substr(.@varname$,0,1) != "$#" ) { debugmes "set_MAC_variable - MAC variables must start with $#"; end; } for (set .@i,2; .@i < getstrlen(.@varname$); set .@i,.@i+1) { if (compare("abcdefghijklmnopqrstuvwxyz0123456789_", substr(.@varname$, .@i,.@i)) == 0) { debugmes "set_MAC_variable - variable names can only contain '_' and alphanumeric characters"; end; } } // re-add the trailing "$" if (.@is_string) set .@varname$, .@varname$ + "$"; // check max lengths if (getstrlen(.@varname$) > 255) { debugmes "set_MAC_variable - variable name longer than 255 characters"; end; } if (.@is_string && getstrlen(.@value$) > 255) { debugmes "set_MAC_variable - string value longer than 255 characters"; end; } else if (!.@is_string && getstrlen(.@value$) > 9) { query_sql "SELECT ('"+ escape_sql(.@value$) +"' BETWEEN -2147483648 AND 2147483647)", .@valid_int; if (!.@valid_int) { debugmes "set_MAC_variable - integer overflow detected"; end; } } if ((.@is_string && .@value$=="") || (!.@is_string && .@value$=="0")) { // value of "" or 0 --> delete variable query_sql "DELETE FROM `mac2_reg_value` WHERE `mac`='"+ @my_MAC$ +"' AND `str`='"+ escape_sql(.@varname$) +"'"; } else { // store the variable!! query_sql "REPLACE INTO `mac2_reg_value` (`mac`,`str`,`value`) VALUES ('"+@my_MAC$+"', '"+ escape_sql(.@varname$) +"', '"+ (.@is_string ? escape_sql(.@value$) : atoi(.@value$)) +"')"; } return; } OnInit: waitingroom "Free Coin",0; end; } brian made this script long time ago Quote
Patskie Posted June 2, 2013 Posted June 2, 2013 Use getitem2 instead of getitem if you want your players have the +7 freebies. *getitem2 <item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>}; *getitem2 "<Item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>}; This command will give an amount of specified items to the invoking character. If an optional account ID is specified, and the target character is currently online, items will be created in their inventory instead. If they are not online, nothing will happen. It works essentially the same as 'getitem' (it even works for negative ID numbers the same way, which is kinda silly) but is a lot more flexible, since it allows you to give the player an item altered with it's specific properties. Those parameters that are different from 'getitem' are: identify - Whether you want the item to be identified or not, 0 unidentified, 1 identified. refine - For how many pluses will it be refined. It will not let you refine an item higher than +10, if you specify more it'll still be 10. attribute - Whether the item is broken (1) or not (0) and NOT an elemental attribute. card1,2,3,4 - If you want a card compound to it, place the card ID number into the specific card slot. Card ID numbers also found in 'db/item_db.txt' Card1-card4 values are also used to store name information for named items, as well as the elemental property of weapons and armor. You can create a named item in this manner, however, if you just need a named piece of standard equipment, it is much easier to the 'getnameditem' function instead. Quote
Diss Posted June 2, 2013 Posted June 2, 2013 [Error]: npc_parsesrcfile: Unknown syntax in file 'npc/custom/freebies.txt', line '1'. Stopping... * w1=prontera,110,56,3 script Freebies Coin 962,{ * w2= * w3= * w4= how to fix this Quote
kamikaze666 Posted June 2, 2013 Posted June 2, 2013 most prolly tab issues, paste the code in notepad++ and rework the spaces into TABs Quote
Patskie Posted June 2, 2013 Posted June 2, 2013 [Error]: npc_parsesrcfile: Unknown syntax in file 'npc/custom/freebies.txt', line '1'. Stopping... * w1=prontera,110,56,3 script Freebies Coin 962,{ * w2= * w3= * w4= how to fix this prontera,110,56,3<TAB>script<TAB>Freebies Coin<TAB>962,{ Quote
Diss Posted June 2, 2013 Posted June 2, 2013 (edited) @patskie thnx its works but everytime i click the npc im still getting the freebies Edited June 2, 2013 by Diss Quote
Question
Lugia
I am looking for freebies script which :
1. Check Mac IP Address to avoid duplicate use of the npc by creating a new account again and again.
2. Which give +7 Equipment
3. If the mac address is already used, s/he can't use the npc again.
6 answers to this question
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.