Jump to content

Korasu

Members
  • Posts

    6
  • Joined

  • Last visited

1 Follower

Profile Information

  • Gender
    Male
  • Location
    California

Recent Profile Visitors

783 profile views

Korasu's Achievements

Poring

Poring (1/15)

0

Reputation

  1. Thanks a ton, you rock. I couldn't find this anywhere lol.
  2. This is a bit of a ridiculous request, but I couldn't find an answer anywhere. I want to enable the setting that identifies all equipment dropped by mobs automatically; I simply cannot find where to define it lol. If someone could tell me, it'd be much appreciated. Thanks in advance.
  3. I'm trying to make an NPC that gives players one item per account, and does a MAC address check to see if any other accounts have received an item from the NPC. The MAC address(es) can be found for by checking the last_mac column in the login database, or with some Harmony script command that I'm unaware of; in Brian's post and script, he used getmacaddress() as a filler. I do have Harmony installed.
  4. Hi Brian, sorry for reviving an old topic; I came across an issue involving this script and I'm not sure where to go from here. This is the error I get when trying to load it: script error on npc/custom/glitch/newplayer.txt line 15 parse_callfunc: expected ')' to close argument list 11 : { 12 : function get_MAC_variable; 13 : function set_MAC_variable; 14 : * 15 : if (get_MAC_variable($'#'lockout)>0) { 16 : mes "I already gave a prize to someone from your MAC address."; 17 : } else { 18 : if (!checkweight(909,1)) { 19 : mes "You are overweight or carrying too many items."; 20 : } else { I also added two more lines after Line 28: function get_MAC_variable { query_sql "select last_mac from login where account_id = " + getcharid(3),.@MAC$; set @MAC$,.@MAC$[0]; // $#variable = MAC variable This was to sorta replace getmacaddress() - I'm not sure if that's even a thing lol. I have Harmony and my needs for this NPC's functions are identical to Frost_'s. If you or anyone has a solution for me, it'd help out a lot. Thanks for reading. Full Script: prontera,165,164,3 script Boy#465asesDA 962,{ function get_MAC_variable; function set_MAC_variable; 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 909,1; // Jellopy set_MAC_variable $#lockout, 1; mes "Here is your prize!"; } } close; function get_MAC_variable { query_sql "select last_mac from login where account_id = " + getcharid(3),.@MAC$; set @MAC$,.@MAC$[0]; // $#variable = MAC variable set .@varname$, strtolower(getarg(0, "null")); set .@is_string, (charat(.@varname$, getstrlen(.@varname$)-1) == "$"); if (query_sql("SELECT `value` FROM `mac_reg_value` WHERE `mac`='"+ @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 `mac_reg_value` WHERE `mac`='"+ @MAC$ +"' AND `str`='"+ escape_sql(.@varname$) +"'"; } else { // store the variable!! query_sql "REPLACE INTO `mac_reg_value` (`mac`,`str`,`value`) VALUES ('"+@MAC$+"', '"+ escape_sql(.@varname$) +"', '"+ (.@is_string ? escape_sql(.@value$) : atoi(.@value$)) +"')"; } return; } }
  5. Original Post: Edit: Nevermind, I found the problem myself. There were several errors that didn't show up on my console, and just some poor code structure. I know none of you who initially read this replied, but I'd like to share the final product anyways to help combat GM corruption. This final script works and functions fully as intended.
×
×
  • Create New...