From c60dc31c74313d2de85bf88b7edb17d6f75d2fff Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Tue, 16 Oct 2018 17:28:24 -0300 Subject: Put some lawn on my cables. :> --- npc/commands/discord.txt | 57 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 npc/commands/discord.txt (limited to 'npc/commands/discord.txt') diff --git a/npc/commands/discord.txt b/npc/commands/discord.txt new file mode 100644 index 000000000..b5ab69fef --- /dev/null +++ b/npc/commands/discord.txt @@ -0,0 +1,57 @@ +// TMW-2 Script. +// Author: +// Jesusalva +// LawnCable +// Notes: +// Controls `discord` table with @discord command. +// Only useful for TMW2-Discord integration. + +- script @discord 32767,{ + end; + +OnCall: + // Anti-Flood System + if (@discord) { + mesc l("You already ran this command today. Please try again at a later time."), 1; + close; + } + + if (!validatepin()) + close; + + @discord=1; + .@nb = query_sql("select `discord_id` from `discord` WHERE `account_id` == "+getcharid(3), .@discord$); + + + do + { + mesn "Lawn Cable"; + mesq l("Current linked Discord account: @@", .@discord$); + next; + select + l("Change Linked Discord Account"), + l("Disconnect"), + l("Quit"); + + switch (@menu) { + case 1: + mesc l("Please insert your Discord ID, on the following format: "), 1; + mesc l("Usename#0000"), 2; + input .@discord$; + mes ""; + query_sql("UPDATE `discord` SET `discord_id` = '"+.@discord$+"' WHERE `account_id` == "+getcharid(3)); + break; + case 2: + query_sql("DELETE FROM `discord` WHERE `account_id` == "+getcharid(3)); + .@discord$=""; + break; + } + + } while (@menu != 3); + close; + +OnInit: + bindatcmd "discord", "@discord::OnCall", 0, 0, 1; + end; +} + -- cgit v1.2.3-70-g09d2