|
DeathDealer Adept
Joined: 20 Jul 2004 Posts: 268
|
Posted: Wed Jul 21, 2004 1:04 pm
#SEND problem |
Read in another post about the #SEND hiding what is sent to the mud so that there is no spam on there. I LOVE IT! but....it don't seem to work in all cases...
Code: |
#send wake
#LOO @madspamtimes {#send c @madspam}
#send sleep quilt
#send show @madspam
|
The @madspamtimes and @madspam are defined elsewhere from a Button, and works on a tick timer. Without the #send's it works perfectly, but WITH the #send's it only goes as far as wake, and then stops working until the next tick, in which it again send wake, which I already am because i never slept
Also have the same prob is other areas like a spellupper.
Code: |
#CLASS mytrigs 0
#VAR spellcounter 0
#FORALL @allmyspells {
#VAR spellcurrent %i
#FORALL @spellsmissing {#IF (%lower( %i) == %lower( @spellcurrent)) {
#ADD spellcounter 1
#send cast '%i'
#IF (@spellcounter > 10) {
#WAIT (7000)
#VAR spellcounter 0
}
}}
}
|
it won't cast anything.
The reason for all this is that I REALLY hate seeing:
Quote: |
wake
c 197
c 197
c 197
c 197
c 197
c 197
c 197
c 197
sle q
show 197
cast 'Adrenaline control'
cast 'Enhanced strength'
cast 'Underwater breathing'
cast 'Thought shield'
cast 'Mental barrier'
|
spammed across my screen
TIA for any helps |
|
|
|
mr_kent Enchanter
Joined: 10 Oct 2000 Posts: 698
|
Posted: Wed Jul 21, 2004 3:42 pm |
No guarantees here. Just shooting from the hip, but worth a try.
I think you need to expand the variable before you send, otherwise the mud will receive c @madspam
Quote: |
#send wake
#LOO @madspamtimes {#send c @{madspam}}
#send sleep quilt
#send show @{madspam} |
This works for sending the value of a variable to another window. I don't know if it works with the #SEND command. |
|
|
|
DeathDealer Adept
Joined: 20 Jul 2004 Posts: 268
|
Posted: Wed Jul 21, 2004 6:00 pm |
I'll try, but since nothing is sent after wake, as in no errors of "You don't know a spell by that name" type of errors and the sleep quilt command is not sent either, I don't think it will work. But i am speaking before I try :-)
I'll update when i do. |
|
_________________
|
|
|
|
DeathDealer Adept
Joined: 20 Jul 2004 Posts: 268
|
Posted: Wed Jul 21, 2004 7:03 pm |
Nope, didnt work :(
|
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Thu Jul 22, 2004 10:02 am |
The #SEND command is also used to send the contents of a text file to the mud. It expects to only see 1 arguement, which it then checks for a filename and then sends the appropiate thing. This is why your second arguement is being ignored.
I still can't seem to say it enough times, use delimeters such as quotes, braces and parenthesis even when you think they aren't needed.
Quotes are proper when no expansion is required, and also used to stop unwanted expansion.
#send "sleep quilt"
Braces can be used almost anywhere. They allow expansion, but are not reccommended for use in expressions; such as #IF (expression)...
#LOO @madspamtimes {#send {c @madspam}}
#send {show @madspam}
#send {cast '%i'} |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
Theragil Apprentice
Joined: 13 Feb 2004 Posts: 157 Location: USA
|
Posted: Thu Jul 22, 2004 10:50 am |
Ah hah, that's why my #send drink health didn't work over in the other thread. #send "drink health" works.
Note that the help file specifically shows #send hello there as an example, not #send "hello there", so those of us who didn't realize #send wants only one argument have a good reason for the mistake. |
|
|
|
DeathDealer Adept
Joined: 20 Jul 2004 Posts: 268
|
Posted: Thu Jul 22, 2004 3:03 pm |
Vijilante, I wish that it actually worked...
#LOO @madspamtimes {#send {c @madspam}}
------------------------------^ filename expected <-- Zmud error
#send {show @madspam}
---------^ filename expected <-- Zmud error
(silly forum and not accepting multiple spaces
Theragil, oddly enuf, my #send sleep quilt works perfectly with out the quotes. so there still might be something weird about yours. and maybe the help file is correct with out the quotes? |
|
|
|
DeathDealer Adept
Joined: 20 Jul 2004 Posts: 268
|
Posted: Thu Jul 22, 2004 3:13 pm |
Oh and #SEND "cast '%i'" gives me You don't know any spells of that name.
So that is wrong as well since cast '%i' worked :( |
|
_________________
|
|
|
|
Theragil Apprentice
Joined: 13 Feb 2004 Posts: 157 Location: USA
|
Posted: Thu Jul 22, 2004 3:55 pm |
I wonder what configuration setting could affect this. It's extremely non-obvious, anyway. But at least now I have it working and the spam is cut down significantly in a lot of situations. I'm happy.
Now I need to get around to making a front end to #untrigger that lets me gag the "trigger removed" message without the threat of gagging something else if there was no trigger to remove. I wish we just had a "#silent" command that did anything you could do otherwise, only silently, so #gag is used to gag things that come from the MUD, not also coopted into trying awkwardly to gag unnecessary messages zMUD itself produces. |
|
|
|
Elric Newbie
Joined: 18 Jul 2004 Posts: 3
|
Posted: Thu Jul 22, 2004 5:14 pm Use %quote |
DeathDealer,
#var temp_variable test
#echo "abc @temp_variable 123"
Output: abc @temp_variable 123
#echo %quote(abc @temp_variable 123)
Output: abc test 123
You are sending the variable name to the mud, not its contents.
Try using the following alias instead of the #send command:
#alias send {#send %quote(%1)}
your example would be:
#loop @madspamtimes {send "c @madspam"}
send "show @madspam"
That work? |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu Jul 22, 2004 5:48 pm |
Quote: |
Vijilante, I wish that it actually worked...
|
Sorry, DD, but it does work. I don't know what you've done to get syntax errors. I put those two exact lines in an alias and the settings editor didn't indicate any syntax errors(version 7.05). I also tested the alias and everything was sent.
Vijilante said, "Quotes are proper when no expansion is required, and also used to stop unwanted expansion." That also means don't use double-quotes if you want your variables expanded.
#SEND {cast '%i'} |
|
_________________ LightBulb
Senior member
Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious. |
|
|
|
DeathDealer Adept
Joined: 20 Jul 2004 Posts: 268
|
Posted: Thu Jul 22, 2004 7:00 pm |
I stand totally corrected...
The code Vijilante gave DOES work perfectly.
I didnt try them because I got the error msg
Code: |
#LOO @madspamtimes {#send {c @madspam}}
^ filename expected |
Which i then took to mean, "This won't work"
But it does....*shrug* damned if i know why i get an error where there IS no error, but maybe that was fixed in a later version.
I just need to get an upgrade :-)
LB, I get the same
Code: |
#SEND {cast '%i'}
^ filename expected |
with yours.
Again, dunno why but it's prolly version related.
But it was just my foolishness that made me say it didnt work without trying it 1st
Thanks for all the help, and next time, my dumb ass is gonna try 1st |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Fri Jul 23, 2004 12:11 am |
Thanks for pointing out the error in the help file. I will put it in the bug list.
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
|
|