Jump to content
  • 0

Command password binding.


Question

Posted (edited)
-	script	asdjkasdj	-1,{
	end;
OnInit:
	bindatcmd "item", strnpcinfo(0)+"::Onaaa";
	end;
Onaaa:
	if ( .@atcmd_parameters$[0] == "*********" )
		atcommand "@item "+ .@atcmd_parameters$[1] +" "+ .@atcmd_parameters$[2];
	else
		message strcharinfo(0), "Wrong password SIR/MAAM";
	end;
}

Hi guys. I just need help. Because I have a problem. As you can see I binded @item w/ a password but a Admin Level GM just needs to use @IteM or @iTem or whatever He/She wants as long as it's @item in different case sensitivity. I just want to know how would I be able to bind the command in any case-sensitive. Thank you for your help guys!

Edited by Ronald

8 answers to this question

Recommended Posts

Posted (edited)

Honestly I think this is a bug...

// @commands (script-based)
struct atcmd_binding_data* get_atcommandbind_byname(const char* name) {
	int i = 0;

	if( *name == atcommand_symbol || *name == charcommand_symbol )
		name++; // for backwards compatibility

	ARR_FIND( 0, atcmd_binding_count, i, strcmpi(atcmd_binding[i]->command, name) == 0 );

	return ( i < atcmd_binding_count ) ? atcmd_binding[i] : NULL;
}

Is a function used to get the bound command.... It uses strcmpi which is case insensitive. I'll ask someone who knows more about source than I do. x_x;;

 

Edit:

 

Alright so I was right it was a bug xD... I compared an older version of rAthena that I had and I can confirm your error, but it was solved in newer versions. If you don't feel like updating...

 

In atcommand.c search for

strcmp(atcmd_binding[i]->command, name)

replace it with

strcmpi(atcmd_binding[i]->command, name)

and recompile.

Edited by Skorm
Added stuff...
  • Upvote 1
Posted

From a script standpoint just manually bind the different case combinations to the same label.

 

Ex:

	bindatcmd "item", strnpcinfo(0)+"::Onaaa";
	bindatcmd "ITEM", strnpcinfo(0)+"::Onaaa";

and everything in between.

Posted

Okay Sir Thank you. Because it would cost alot of time if I'm going to bind all the following possible case on a specific command. And Sir Emistry also told me about the charisupper and charislower this but I don't know how to use those things.

Posted

Okay Sir Thank you. Because it would cost alot of time if I'm going to bind all the following possible case on a specific command. And Sir Emistry also told me about the charisupper and charislower this but I don't know how to use those things.

 

I modified my above post.

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.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...