Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Neuro
Beginner


Joined: 22 Feb 2007
Posts: 19

PostPosted: Sun Feb 17, 2008 4:51 am   

Kill Buffer Script problem..
 
This scrip was made for ZMUD.. I wish I knew enough to really fix it. I'm gonna play around with it but thought maybe someone in here would see and and be like.. OH THAT NEEDS CHANGED TO THIS.. in seconds.

Here is the script:



Code:
#TRIGGER {(%w) is DEAD!!} {#var linebefore1 %line2;#var fullmobname %replace(%left(%trigger,%pos(" is",%trigger))," ","");#show MOB : @fullmobname JUST DIED;#show LINE1BEFOREKILL : @linebefore1;#var killedit %word(@linebefore1,1);#if (%pos("You",@killedit) > 0) {#show YOU GOT THE KILL;killlistadd @fullmobname};#if (@look = 0) {look;#var look 1};save;#noop fullmobname = left portion of string before " is DEAD!" with spaces removed;#noop if you have "a young turtle is DEAD!" then fullmobname = "ayoungturtle"} {+} 5

#ALIAS killlistclear {#var listokills {""};#var listkillnum 0;#show Kill List Emptied.} {killlist}

#ALIAS killlistadd {#var itemtoadd %1;#var numkills {""};#var itemtoadd2 {""};#var mobname {""};#var mobnameandnum {""};#var mobnamefound 0;#var listkillnum %numwords(@listokills,|);#show Scanning list for @itemtoadd;#if (@listkillnum > 0) {#loo 1,@listkillnum {#var itemtocheck %i;#math itemtocheck @listkillnum-@itemtocheck;#math itemtocheck @itemtocheck+1;#var itemtodel %word(@listokills,%i,|);#var listkillnum %numwords(@listokills,|);#var numkills %word(@itemtodel,1,/);#var mobname %word(@itemtodel,2,/);#if (@mobnamefound = 0) {#if (@mobname = @itemtoadd) {#show Found @itemtoadd;#var mobnamefound 1;#show REMOVING : @itemtodel;#var listokills %delitem(@itemtodel,@listokills);#show INCREMENTING @itemtodel;#math numkills @numkills+1;#var itemtoadd @numkills/@mobname;#show RE-ADDING NEW : @itemtoadd;#var listokills %additem(@itemtoadd,@listokills)} } } };#if (@mobnamefound = 0) {#var itemtoadd2 1/@itemtoadd;#show @itemtoadd not found, adding new : @itemtoadd2;#var listokills %additem(@itemtoadd2,@listokills)};#var listkillnum %numwords(@listokills,|);#show End of KILLLISTADD;killlist50} {killlist}

#ALIAS killlistshow {#show Items in buffer kill list : @listkillnum;#if (@listkillnum > 0) {#show Oldest kills listed first:;#loop 1,@listkillnum {#show Buffer Entry %i : %word(@listokills,%i,|) } }} {killlist}

#ALIAS killlist50 {#var listkillnum %numwords(@listokills,|);#if (@listkillnum > 50) {#var itemtodel %word(@listokills,1,|);#show CLEARING @itemtodel OFF OF KILLLIST;#var listokills %delitem(@itemtodel,@listokills)};#var listkillnum %numwords(@listokills,|);#noop keep list down to 50 items, removing oldest item} {killlist}

#ALIAS killlistfind {#show Items in buffer kill list : @listkillnum;#if (@listkillnum > 0) {#show Oldest kills listed first:;#loop 1,@listkillnum {#if (%pos(%1,%word(@listokills,%i,|)) > 0) {#show Buffer Entry %i : %word(@listokills,%i,|)} } }} {killlist}

#ALIAS killlistfile {#show Items in buffer kill list : @listkillnum;#var playername Zistrosk;#var now %time(ddmmmyy|hh:mm:ss);#var namett %concat(@curdate,"kb.txt");#file 2 @namett;#write 2 @now-@playername Kill Buffer ~(oldest kills listed first~):;#if (@listkillnum > 0) {#loop 1,@listkillnum {#write 2 Buffer Entry %i : %word(@listokills,%i,|) } };#close 2} {killlist}


This is what the error is showing:

Code:
#TRIGGER {(%w) is DEAD!!} {#var linebefore1 %line2;#var fullmobname %replace(%left(%trigger,%pos(" is",%trigger))," ","");#show MOB : @fullmobname JUST DIED;#show LINE1BEFOREKILL : @linebefore1;#var killedit %word(@linebefore1,1);#if (%pos("You",@killedit) > 0) {#show YOU GOT THE KILL;killlistadd @fullmobname};#if (@look = 0) {look;#var look 1};save;#noop fullmobname = left portion of string before " is DEAD!" with spaces removed;#noop if you have "a young turtle is DEAD!" then fullmobname = "ayoungturtle"} {+} 5
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Sun Feb 17, 2008 6:46 am   
 
The error is that you are using the #noop for your comments and that you have = signs in your noops.

The fastest way to fix the error is to put ~ before the = like this.
Code:
#TRIGGER {(%w) is DEAD!!} {#var linebefore1 %line2;#var fullmobname %replace(%left(%trigger,%pos(" is",%trigger))," ","");#show MOB : @fullmobname JUST DIED;#show LINE1BEFOREKILL : @linebefore1;#var killedit %word(@linebefore1,1);#if (%pos("You",@killedit) > 0) {#show YOU GOT THE KILL;killlistadd @fullmobname};#if (@look = 0) {look;#var look 1};save;#noop fullmobname ~= left portion of string before " is DEAD!" with spaces removed;#noop if you have "a young turtle is DEAD!" then fullmobname ~= "ayoungturtle"} {+} 5


Of course you should probably use ; or // for your comments in cMud instead of all of those #noops.

You could also just say equals instead of using the = sign...
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net