Help - Search - Members - Calendar
Full Version: Dusty's Antitheft Script
Achaea's Forums > Off-Topic > Tech Support
Haren
So, I just recently got Dusty's antitheft after a while of dormancy, and I'm having some troubles with it. Whenever I do the UPDATE_ANTITHEFT alias to scan my inventory, and then do SHOW_ANTITHEFT, nothing comes up, and it tells me to update again. Anyone know what could be happening? Thanks.
Trilliana
honestly, for some reason it works for me when I use Vadi's, but it doesn't when I use the old Acropolis. I don't know what it is about it, but I'll post what I have for the script in case I've fixed it recently and don't remember

CODE
#var pause 0 0
#PROMPT name {Please enter your Achaean character name:}
#CLASS {Statistics}
#TRIGGER {You have recovered equilibrium.} {#VAR EQ 0}
#TRIGGER {You have recovered balance on all limbs.} {#VAR balance 0}
#TRIGGER {(%d)h, (%d)m (*)-} {#VAR health %1;#VAR mana %2;#if (%pos( e, %3)>0) {#var EQ 0} {#var EQ 1};#if (%pos( x, %3)>0) {#var balance 0}  {#var balance 1}} "" {nocr|prompt}
#TRIGGER {(%d)h, (%d)m, (%d)e, (%d)w (*)-} {#VAR health %1;#VAR mana %2;#VAR endurance %3;#VAR willpower %4;#if (%pos( e, %5)>0) {#var EQ 0} {#var EQ 1};#if (%pos( x, %5)>0) {#var balance 0} {#var balance 1}} "" {nocr|prompt}
#TRIGGER {(%d)h, (%d)m, (%d)e (*)-} {#VAR health %1;#VAR mana %2;#VAR endurance %3;#if (%pos( e, %4)>0) {#var EQ 0} {#var EQ 1};#if (%pos( x, %4)>0) {#var balance 0} {#var balance 1}} "" {nocr|prompt}
#TRIGGER {(%d)h, (%d)m, (%d)w (*)-} {#VAR health %1;#VAR mana %2;#VAR willpower %3;#if (%pos( e, %4)>0) {#var EQ 0} {#var EQ 1};#if (%pos( x, %4)>0) {#var balance 0} {#var balance 1}} "" {nocr|prompt}
#TRIGGER {You are level (%d) ~(*~) and (%d)~% of the way} {#IF (%2>@percent) {#SAY %ansi( white)Percent up by: %ansi( yellow)%eval( %2-@percent)%ansi( white), current percent: %2};#VAR level %1;#VAR percent %2}
#COND {Health:%s(%d) /%s(%d)%sMana:%s(%d) /%s(%d)} {#VAR health %1;#VAR maxhealth %2;#VAR mana %3;#VAR maxmana %4} {within|param=2}
#COND {Endurance:%s(%d) /{| }(%d)%sWillpower:%s(%d) /{| }(%d)} {#VAR endurance %1;#VAR maxendurance %2;#VAR willpower %3;#VAR maxwillpower %4} {within|param=1}
#COND {Strength: (%d)%sDexterity: (%d)%sConstitution: (%d)%sIntelligence: (%d)} {#VAR strength %1;#VAR dexterity %2;#VAR constitution %3;#VAR intelligence %4} {within|param=1}
#CLASS 0
#CLASS {Statistics|Pauses}
#TRIGGER {You raise your spiritual mace over %w to pass judgement} {#var pause 1}
#TRIGGER {You cease waving your sword.} {#var pause 0}
#TRIGGER {You lower your mace and cease passing judgement.} {#var pause 0}
#TRIGGER {You cease your judgement.} {#var pause 0}
#TRIGGER {With a roar of righteous fury, you bring your burning, shrieking mace down} {#var pause 0}
#TRIGGER {You slowly pull back a *, readying yourself} {#var pause 1}
#TRIGGER {You strike the * of %w a mighty blow.} {#var pause 0}
#TRIGGER {You cease concentrating on shattering your opponent's limbs.} {#var pause 0}
#TRIGGER {has fled your righteous grasp.} {#var pause 0}
#CLASS 0
#YESNO "Do you have selfishness?" {#var has_selfishness 1} {#var has_selfishness 0}
#SAY {}
#SAY You've successfully installed the mandatary import!.
#SAY Uses QSC to update statistics.
#ALARM +3 {qsc}


CODE
#DELCLASS Antitheft
#CLASS {AntiTheft}
#ALIAS buy {take coin from @container;~buy %-1;put coin in @container}
#ALIAS container {#IF (%null(%1)) {#PROMPT container {Enter the numberID of desired default container.};#SAY Default gold container set to: @container} {#VAR container %1;#SAY Default gold container set to: %1}}
#ALIAS show_antitheft {#SAY {%crlf};#SAY %ansi( green)Item Description%repeat(" ",48)Number;#SAY %ansi( grey)----------------------------------------------------------------------;#LOOPDB @wearing {#SAY {%if( %eval( %iskey( @wearing, {%key})\2)=1, %ansi( black, high), %ansi( grey))%key %repeat( ., 62-%len( %key)) %val}};#IF (%numkeys( @wearing)=0) {#SAY %ansi( white)No items saved into database... Please UPDATE_ANTITHEFT}}
#ALIAS update_antitheft {#VAR wearing {};#T+ {ii_more};#T+ {rewear_checkfirst};~ii worn}
#TRIGGER "rewear_checkfirst" {^You are wearing:$} {#UNVAR rewear;#T+ {rewear_inv}} "" {disable}
#TRIGGER "ii_more" {Type MORE to continue reading.} {more;#UNTRIGGER {ii_timer};#ALARM "ii_timer" +2 {#T- {ii_more}}} "" {disable}
#TRIGGER "rewear_inv" {~"(%w)(%d)~"%s(*)} {#ADDKEY wearing {%3} %2;#UNTRIGGER {rewear_alarm};#ALARM "rewear_alarm" +2 {#T- {rewear_inv};#T- {rewear_checkfirst}}} "" {disable}
#TRIGGER {Trigger ~{{ii_timer|rewear_alarm}~} removed.} {#GAG}
#TRIGGER {^You remove (%w) (*).} {#SAY %ansi( yellow, blink)***WARNING!!! BE CAREFUL***;#SAY %ansi( green, blink)***WARNING!!! BE CAREFUL***;#VAR removed {%1 %2};#LOOPDB @wearing {#IF ({@removed}={%key}) {#IF (%pos( suit, {@removed})>0) {#VAR armour %val;#TEMP {You have recovered balance on all limbs.} {wear @armour}} {wear %val}}}}
#TRIGGER {{You are far too selfish to give anything away.|You are far too selfish to throw anything away like that.|You're far too selfish to just throw away liquid wealth like that.|You are far too selfish to throw that away.}} {#SAY %ansi( yellow, blink)***WARNING!!! BE CAREFUL***;#SAY %ansi( green, blink)***WARNING!!! BE CAREFUL***}
#TRIGGER {You begin to wield some gold sovereigns in your left hand.} {unwield gold;put coin in @container;wear @container;#SAY %ansi( yellow, blink)***WARNING!!! BE CAREFUL***;#SAY %ansi( green, blink)***WARNING!!! BE CAREFUL***}
#TRIGGER {(%w) quickly flings a Hierophant tarot card at you.} {#SAY %ansi( yellow, blink)***WARNING!!! BE CAREFUL***;#SAY %ansi( green, blink)***WARNING!!! BE CAREFUL***;wear @container;put coin in @container;lose %1}
#TRIGGER {(%w) flings a tarot card with the image of the Hierophant at you.} {#SAY %ansi( yellow, blink)***WARNING!!! BE CAREFUL***;#SAY %ansi( green, blink)***WARNING!!! BE CAREFUL***;wear @container;put coin in @container;lose %1}
#TRIGGER {(%w) snaps {his|her} fingers in front of you.} {#CW 46;#SAY %ansi( yellow, blink)***WARNING!!! BE CAREFUL***;#SAY %ansi( green, blink)***WARNING!!! BE CAREFUL***;wear @container;put coin in @container;put letter in @container;put letter in @container;lose %1}
#TRIGGER {chaos flows from it and into your very being.} {#SAY %ansi( yellow, blink)***WARNING!!! BE CAREFUL***;#SAY %ansi( green, blink)***WARNING!!! BE CAREFUL***;stand;wear @container;put coin in @container;probe soulmaster;lose soulmaster}
#TRIGGER {You feel your will manipulated by the soulmaster entity.} {#SAY %ansi( yellow, blink)***WARNING!!! BE CAREFUL***;#SAY %ansi( green, blink)***WARNING!!! BE CAREFUL***;stand;wear @container;put coin in @container;probe soulmaster;lose soulmaster}
#TRIGGER {A soulmaster lets loose a stream of primal chaos that flows into you.} {#SAY %ansi( yellow, blink)***WARNING!!! BE CAREFUL***;#SAY %ansi( green, blink)***WARNING!!! BE CAREFUL***;stand;wear @container;put coin in @container;probe soulmaster;lose soulmaster}
#TRIGGER {A dark stream of primal chaos flows out of} {#SAY %ansi( yellow, blink)***WARNING!!! BE CAREFUL***;#SAY %ansi( green, blink)***WARNING!!! BE CAREFUL***;stand;wear @container;put coin in @container;probe soulmaster;lose soulmaster}
#TRIGGER {You feel irresistibly compelled to} {#SAY %ansi( yellow, blink)***WARNING!!! BE CAREFUL***;#SAY %ansi( green, blink)***WARNING!!! BE CAREFUL***;wear @container;put coin in @container}
#TRIGGER {(%w) frowns in concentration, and a booming voice rings in your head} {#SAY %ansi( yellow, blink)***WARNING!!! BE CAREFUL***;#SAY %ansi( green, blink)***WARNING!!! BE CAREFUL***;wear @container;put coin in @container;lose %1}
#TRIGGER {You cease to wield a Druidic quarterstaff.} {#SAY %ansi( yellow, blink)***WARNING!!! BE CAREFUL***;#SAY %ansi( green, blink)***WARNING!!! BE CAREFUL***;wield staff;flail staff}
#TRIGGER {You cease to wield a sharpened quarterstaff.} {#SAY %ansi( yellow, blink)***WARNING!!! BE CAREFUL***;#SAY %ansi( green, blink)***WARNING!!! BE CAREFUL***;wield staff;flail staff}
#CLASS 0
#PROMPT container {Enter the numberID of desired default container.}
#SAY {}
#SAY {You've successfully installed your Anti-Theft script.}
#SAY {Make sure you set your container to whatever you want your gold in!}
#SAY {The following commands can be used with this script:}
#SAY {CONTAINER [item#]   : Sets your container, if item is omitted, easier prompt setting pops up.}
#SAY {UPDATE_ANTITHEFT    : Will cycle through your inventory and save what you wear.}
#SAY {SHOW_ANTITHEFT      : Will show the database of items the script has saved.}
#ALARM +3 {#T- {rewear_inv};#T- {rewear_checkfirst};#T- {ii_more}}
Haren
Okay, thank you very much. I'll try it out.
Cauthorn
There was a change in one of the inventory lines, so it doesn't update properly. I still can't get mine to acknowledge multiples of the same item. Here's my edited version of his, it at least works partially.

CODE
#CLASS {AntiTheft}
#ALIAS buy {take money from @container;~buy %-1;put money in @container}
#ALIAS container {#VAR container %1;#SAY Default gold container set to: %1}
#ALIAS show_antitheft {#SAY {%crlf};#SAY %ansi( green)"Item Description                                                Number";#SAY %ansi( grey)----------------------------------------------------------------------;#LOOPDB @wearing {#SAY {%if( %eval( %iskey( @wearing, {%key})\2)=1, %ansi( black, high), %ansi( grey))%key %repeat( ., 62-%len( %key)) %val}};#IF (%numkeys( @wearing)=0) {#SAY %ansi( white)No items saved into database... Please UPDATE_ANTITHEFT}}
#ALIAS update_antitheft {#VAR wearing {};#T+ "ii_more";#T+ "rewear_checkfirst";~ii}
#TRIGGER "rewear_checkfirst" {^You are wearing:$} {#UNVAR rewear;#T+ "rewear_inv"} "" {disable}
#TRIGGER {You get * gold sovereigns from a *.} {put money in @container}
#TRIGGER "ii_more" {[Type MORE if you wish to continue reading.} {more;#UNTRIGGER "ii_timer";#ALARM "ii_timer" +2 {#T- "ii_more"}} "" {verbatim|disable}
#TRIGGER "rewear_inv" {~ (%w)(%d)~ %s(*)} {#ADDKEY wearing {%3} %2;#UNTRIGGER "rewear_alarm";#ALARM "rewear_alarm" +2 {#T- "rewear_inv";#T- "rewear_checkfirst"}} "" {disable}
#TRIGGER {Trigger ~{{ii_timer|rewear_alarm}~} removed.} {#GAG}
#TRIGGER {^You remove (%w) (*).} {#SAY %ansi( yellow, blink)***WARNING!!! BE CAREFUL***;#SAY %ansi( green, blink)***WARNING!!! BE CAREFUL***;#VAR removed {%1 %2};#LOOPDB @wearing {#IF ({@removed}={%key}) {#IF (%pos( suit, {@removed})>0) {#VAR armour %val;#TEMP {You have recovered balance on all limbs.} {wear @armour}} {wear %val}}}}
#TRIGGER {{You are far too selfish to give anything away.|You are far too selfish to throw anything away like that.|You're far too selfish to just throw away liquid wealth like that.|You are far too selfish to throw that away.}} {#SAY %ansi( yellow, blink)***WARNING!!! BE CAREFUL***;#SAY %ansi( green, blink)***WARNING!!! BE CAREFUL***}
#TRIGGER {You begin to wield some gold sovereigns in your left hand.} {unwield gold;put gold in @container;wear @container;#SAY %ansi( yellow, blink)***WARNING!!! BE CAREFUL***;#SAY %ansi( green, blink)***WARNING!!! BE CAREFUL***}
#TRIGGER {(%w) quickly flings a Hierophant tarot card at you.} {#SAY %ansi( yellow, blink)***WARNING!!! BE CAREFUL***;#SAY %ansi( green, blink)***WARNING!!! BE CAREFUL***;wear @container}
#TRIGGER {(%w) snaps {his|her} fingers in front of you.} {#CW 46;#SAY %ansi( yellow, blink)***WARNING!!! BE CAREFUL***;#SAY %ansi( green, blink)***WARNING!!! BE CAREFUL***;wear @container}
#TRIGGER {chaos flows from it and into your very being.} {#SAY %ansi( yellow, blink)***WARNING!!! BE CAREFUL***;#SAY %ansi( green, blink)***WARNING!!! BE CAREFUL***;wear @container;lose soulmaster}
#CLASS 0
Haren
Thanks Cauthorn, worked great.
Jonathin
Lol, make your own?

It's not hard to do:

#regex {^You remove (.+?)\.$} {#forall %db(@mycrap,%1) {wear %1}}
#va mycrap {a canvas backpack=pack12345|a pair of pants=pants12345}

You remove a canvas backpack.
wear pack12345

You remove a pair of pants.
wear pants12345
Jonathin
{wear %i}

not {wear %1}
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.