Trigger Question

Posted by Excalibur on Mon 16 Sep 2002 02:14 AM — 2 posts, 12,875 views.

#0
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
USA #1
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.