Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Tips and tricks ➜ Trigger Question

Trigger Question

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Excalibur   (4 posts)  Bio
Date Mon 16 Sep 2002 02:14 AM (UTC)
Message
I have "auction triggers" set up over tells on the mud I play. But unfortunately we have some immature players, who spam me with "list" which in turn spams both of our screans with the trigger going off. I had an idea to set up a "insta-ignor" trigger, but then thought, what if the player is hidden. I was just wondering if there was a way i could set a timmer that wouldnt let the trigger go off more than like 5 times in 30 seconds, or somthing of the sort. If you have any suggestions, please reply, or email me at NcHeels0440@aol.com


Thanks again,
Excalibur
Top

Posted by Shadowfyr   USA  (1,792 posts)  Bio
Date Reply #1 on Mon 16 Sep 2002 03:13 AM (UTC)

Amended on Mon 16 Sep 2002 06:12 PM (UTC) by Shadowfyr

Message
One solution is to make your auction trigger call a script instead, so it would be like:

Trigger: ^.* tells you: list
Regexp: True
Script: Auction

The script would check a list of 'banned' names so you can simply gag the offenders. ;)

Script>

sub Auction (name, output, wilds)
  dim Names, IList, Prices
  Names = split(world.getvariable("Auct_Names")
  IList = split(world.getvariable("IList")
  Prices = split(world.getvariable("Prices")
  dim count, fnd
  fnd = 0
  for count = 0 to ubound(Names)
    if lcase(wilds(1)) = Names(count) then
      fnd = 1
    end if
  next
  dim clip, pad
  if fnd = 0 then
    world.send "to tell " & lcase(wilds(1))
    for count = 0 to ubound(IList)
      'Figure out spacing based on your name and padding for prices (assumes 70 columns).
      pad = 10 - len(Price(count))
      clip = left(IList(count),46 - len("your name here"))
      world.send IList(count) & "    " & space(pad) & Prices(count)
    next
    world.send "."
  end sub
end sub

Then you can set it up so you have an alias to let you add and remove items from the list or ban the people:

Alias: auction * *
Name: Agu_auct
script: Set_auction

Alias: auction * * *
Name: Add_auct
script: Set_auction

Script>

Set_auction (name, output, wilds)
  dim test
  test = lcase(wilds)
  select case test
    case "add"
      ' Add your code here...
    case "del"
      ' Add your code here...
    case "gag"
      ' Add your code here...
    case "ungag"
      ' Add your code here...
   end select
end sub


Adding and deleting can be a bit complicated and I don't really have time to write a 'working' version tonight, so good luck. ;) lol Maybe tomarrow I will work on one, since this could be useful to me as well.

One adjustment could be to turn off logging during the sending of the lines and shorten the clipping from 46 to 44, you could then add unique characters like '~-' in front of each items and create a trigger to gag lines with '*~-*'. Then you could ignore the morons that spam your auction trigger completely and avoid the need for gag code, or even for that matter the entire script.

However, the ability to build an auction list could still be helpful.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


12,342 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.