From b69bafdb60b507ef57fd32ce4ed12efeb78062b6 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Tue, 13 Apr 2021 18:05:36 -0300 Subject: I actually forgot part of my debug toolkit --- npc/commands/debug.txt | 75 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) (limited to 'npc/commands') diff --git a/npc/commands/debug.txt b/npc/commands/debug.txt index 0529d2fe..3747156f 100644 --- a/npc/commands/debug.txt +++ b/npc/commands/debug.txt @@ -528,9 +528,76 @@ L_ResetAll: goto L_Begin; L_close: - close2; + closeclientdialog; return; +OnSetVar: + if (getarraysize(.@atcmd_parameters$) != 3) + Exception("Usage: @set-var VARIABLE INDEX VALUE", RB_DISPBOTTOM|RB_ISFATAL); + + .@cmd$=array_shift(.@atcmd_parameters$); + .@idx=atoi(array_shift(.@atcmd_parameters$)); + if (charat(.@atcmd_parameters$[0], + getstrlen(.@atcmd_parameters$[0])-1) == "$") + .@str=true; + + if (.@str) + .@val$=array_shift(.@atcmd_parameters$); + else + .@val=array_shift(.@atcmd_parameters$); + + if (.@str) + setd(sprintf("%s[%d]", .@cmd$, .@idx), .@val$); + else + setd(sprintf("%s[%d]", .@cmd$, .@idx), .@val); + + .@msg$=sprintf("%s[%d] is now: %s", .@cmd$, .@idx, + getd(sprintf("%s[%d]", .@cmd$, .@idx))); + + if (!is_trusted()) + atcommand("@request System Information: "+.@msg$); + else + dispbottom(.@msg$); + end; + +// If the char is not a staff member, it'll be sent to GM Log instead +OnGetVar: + if (getarraysize(.@atcmd_parameters$) != 2) + Exception("Usage: @get-var VARIABLE INDEX", RB_DISPBOTTOM|RB_ISFATAL); + + .@cmd$=array_shift(.@atcmd_parameters$); + .@idx=atoi(array_shift(.@atcmd_parameters$)); + + .@mg$=sprintf("%s[%d] == %s", .@cmd$, .@idx, + getd(sprintf("%s[%d]", .@cmd$, .@idx))); + + if (!is_trusted()) + atcommand("@request System Information: "+.@mg$); + else + dispbottom(.@mg$); + end; + +OnSClear: + sc_end SC_ALL; + sc_end SC_DAILYSENDMAILCNT; + dispbottom l("Status Condition Cleared"); + end; + +OnAllperms: + if (@allperms) end; + charcommand("@addperm all_skill"); + charcommand("@addperm all_equipment"); + charcommand("@addperm skill_unconditional"); + charcommand("@addperm join_chat"); + charcommand("@addperm hide_session"); + charcommand("@addperm any_warp"); + charcommand("@addperm view_hpmeter"); + charcommand("@addperm view_equipment"); + charcommand("@addperm receive_requests"); + charcommand("@addperm can_trade_bound"); + charcommand("@addperm bypass_nostorage"); + @allperms=true; + end; } - script Debug Spell NPC32767,{ @@ -543,6 +610,12 @@ OnDeprecated: end; OnInit: registercmd "@debug", "Debug Spell::OnDebug"; + bindatcmd "getvar", "Debug::OnGetVar", 99, 99, 1; + bindatcmd "get-var", "Debug::OnGetVar", 99, 99, 1; + bindatcmd "setvar", "Debug::OnSetVar", 99, 99, 1; + bindatcmd "set-var", "Debug::OnSetVar", 99, 99, 1; + bindatcmd "sclear", "Debug::OnSClear", 99, 99, 1; + bindatcmd "allperms", "Debug::OnAllPerms", 99, 100, 1; end; } -- cgit v1.2.3-60-g2f50