ZerotoHero 0 Posted April 9, 2014 can somebody help me to edit autoloot script, so any player in level 50 or higher can't do the auto loot commandthanks for your help Quote Share this post Link to post Share on other sites
0 evilpuncker 503 Posted April 9, 2014 try this http://upaste.me/3fef11704c469a6b0 1 ZerotoHero reacted to this Quote Share this post Link to post Share on other sites
0 ZerotoHero 0 Posted April 10, 2014 try this http://upaste.me/3fef11704c469a6b0 wow ty for this mate Quote Share this post Link to post Share on other sites
0 jaBote 438 Posted April 10, 2014 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? Quote Share this post Link to post Share on other sites
0 Dastgir 1246 Posted April 10, 2014 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";} Quote Share this post Link to post Share on other sites
0 ZerotoHero 0 Posted April 11, 2014 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 Quote Share this post Link to post Share on other sites
0 jaBote 438 Posted April 11, 2014 Try this, a mixture of what everybody said here: - 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;} 1 ZerotoHero reacted to this Quote Share this post Link to post Share on other sites
0 ZerotoHero 0 Posted April 11, 2014 (edited) i already do that sir, but when i type the @autoloot command nothing appear or happen. even when im unload the npcthe autoloot command seems not working, whats wrong with my hercules @_@ PS: im using the lastest Hercules Edited April 11, 2014 by ZerotoHero Quote Share this post Link to post Share on other sites
0 Samuel 83 Posted April 12, 2014 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 Quote Share this post Link to post Share on other sites
0 Dastgir 1246 Posted April 12, 2014 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... - 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;} Quote Share this post Link to post Share on other sites
0 Angelmelody 221 Posted April 12, 2014 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[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; } Quote Share this post Link to post Share on other sites
0 Samuel 83 Posted April 12, 2014 Well, it could have limitation. I have tried it in binding other commands.. But since this topic is regarding autoloot, then it can be done through that workaround.. Quote Share this post Link to post Share on other sites
0 evilpuncker 503 Posted April 13, 2014 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[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; } Ind fixed strcmpi thing has some time already xD Quote Share this post Link to post Share on other sites
0 Angelmelody 221 Posted April 13, 2014 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[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; } 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 Quote Share this post Link to post Share on other sites
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
Share this post
Link to post
Share on other sites