No autoloot in level 50 or higher

ZerotoHero

New member
Messages
11
Points
0
can somebody help me to edit autoloot script, so any player in level 50 or higher can't do the auto loot command

thanks for your help

 
wow ty for this mate 
default_biggrin.png


 
I'd src edit it or complicate the NPC a bit, since you may have it enabled, reach to lvl 50 and this script would make it unable to disable it via the command, thus having autoloot till you relog. Also... Seems you never use the atcommand by the useatcmd script command?

 
I'd src edit it or complicate the NPC a bit, since you may have it enabled, reach to lvl 50 and this script would make it unable to disable it via the command, thus having autoloot till you relog. Also... Seems you never use the atcommand by the useatcmd script command?
We can have that check by following
Code:
OnPCBaseLvUpEvent:if (BaseLevel >=50){ atcommand "@autoloot 0";}
 
I'd src edit it or complicate the NPC a bit, since you may have it enabled, reach to lvl 50 and this script would make it unable to disable it via the command, thus having autoloot till you relog. Also... Seems you never use the atcommand by the useatcmd script command?
We can have that check by following
OnPCBaseLvUpEvent:if (BaseLevel >=50){ atcommand "@autoloot 0";}
thanks for the answer sir, but my another question is when your level are below 50, the autoloot command seems not working and no effect at all

 
Try this, a mixture of what everybody said here:

Code:
-	script	atcmd_example	-1,{OnInit:	bindatcmd "autoloot",strnpcinfo(3)+"::OnAtcommand";	end;OnAtcommand:	if (BaseLevel >= 50)	{		dispbottom "You can't use this command.";	} else {		useatcmd .@atcmd_command$;	}	end;OnPCBaseLvUpEvent:	if (BaseLevel >= 50) {		atcommand "@autoloot 0";	}	end;}
 
Last edited by a moderator:
i already do that sir, but when i type the @autoloot command nothing appear or happen. even when im unload the npc
the autoloot command seems not working, whats wrong with my hercules @_@

PS: im using the lastest Hercules

 
Last edited by a moderator:
it's because it's binded, meaning everything that's been in the script, that will be done.

the best thing to do is write a plugin to overwrite the command

 
it's because it's binded, meaning everything that's been in the script, that will be done.

the best thing to do is write a plugin to overwrite the command
Noo,, Script can work well...

Code:
-	script	atcmd_example	-1,{OnInit:	bindatcmd "autoloot",strnpcinfo(3)+"::OnAtcommand";	end;OnAtcommand:	if (BaseLevel >= 50)	{		dispbottom "You cannot use this command.";	} else {		atcommand "@autoloot "+atoi(.@atcmd_parameters$);	}	end;OnPCBaseLvUpEvent:	if (BaseLevel >= 50) {		atcommand "@autoloot 0";	}	end;}
 
I think bindatcmd was not overwriting original cmd  properly, Cause bindatcmd was case sensitive , so it can still 

be used by converting cmd letters to uppercase/lowercase

e.g.

@AUToloot 100

require modification on atcommand.c to make it non -case -sensitive

Code:
diff --git a/src/map/atcommand.c b/src/map/atcommand.cindex 719b140..2b0770d 100644--- a/src/map/atcommand.c+++ b/src/map/atcommand.c@@ -64,7 +64,7 @@ struct atcmd_binding_data* get_atcommandbind_byname(const char* name) { 	if( *name == atcommand->at_symbol || *name == atcommand->char_symbol ) 		name++; // for backwards compatibility -	ARR_FIND( 0, atcommand->binding_count, i, strcmp(atcommand->binding[i]->command, name) == 0 );+	ARR_FIND( 0, atcommand->binding_count, i, strcmpi(atcommand->binding[i]->command, name) == 0 );  	return ( i < atcommand->binding_count ) ? atcommand->binding[i] : NULL; }
 
Well, it could have limitation.
default_smile.png
I have tried it in binding other commands.. But since this topic is regarding autoloot, then it can be done through that workaround..
default_smile.png


 
I think bindatcmd was not overwriting original cmd  properly, Cause bindatcmd was case sensitive , so it can still 

be used by converting cmd letters to uppercase/lowercase

e.g.

@AUToloot 100

require modification on atcommand.c to make it non -case -sensitive

diff --git a/src/map/atcommand.c b/src/map/atcommand.cindex 719b140..2b0770d 100644--- a/src/map/atcommand.c+++ b/src/map/atcommand.c@@ -64,7 +64,7 @@ struct atcmd_binding_data* get_atcommandbind_byname(const char* name) { if( *name == atcommand->at_symbol || *name == atcommand->char_symbol ) name++; // for backwards compatibility - ARR_FIND( 0, atcommand->binding_count, i, strcmp(atcommand->binding->command, name) == 0 );+ ARR_FIND( 0, atcommand->binding_count, i, strcmpi(atcommand->binding->command, name) == 0 ); return ( i < atcommand->binding_count ) ? atcommand->binding : NULL; }




Ind fixed strcmpi thing has some time already xD

 
I think bindatcmd was not overwriting original cmd  properly, Cause bindatcmd was case sensitive , so it can still 

be used by converting cmd letters to uppercase/lowercase

e.g.

@AUToloot 100

require modification on atcommand.c to make it non -case -sensitive

diff --git a/src/map/atcommand.c b/src/map/atcommand.cindex 719b140..2b0770d 100644--- a/src/map/atcommand.c+++ b/src/map/atcommand.c@@ -64,7 +64,7 @@ struct atcmd_binding_data* get_atcommandbind_byname(const char* name) { if( *name == atcommand->at_symbol || *name == atcommand->char_symbol ) name++; // for backwards compatibility - ARR_FIND( 0, atcommand->binding_count, i, strcmp(atcommand->binding->command, name) == 0 );+ ARR_FIND( 0, atcommand->binding_count, i, strcmpi(atcommand->binding->command, name) == 0 ); return ( i < atcommand->binding_count ) ? atcommand->binding : NULL; }




Ind fixed strcmpi thing has some time already xD


Ouch! dunno why my local git master  don't have that commit  I'll check and re-download again

 
Back
Top