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 ➜ General ➜ Another thing....

Another thing....

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


Posted by David B   USA  (80 posts)  Bio
Date Fri 23 May 2003 03:47 AM (UTC)

Amended on Fri 23 May 2003 04:31 AM (UTC) by David B

Message
Sorry for the second post, but this is kinda bothering me too.

part of my script

world.addtrigger "SkillHlt", T1 & T2 & T3, "", 1065, tcolor, 0, "", ""

I need to add the flag for "repeat on same line" to that trigger.


Addmendum:
Need help with minor bug

sub Addskill(aname, output, wilds)
  dim tcolor 
  tcolor = 1 'Change this to the custom color you use. 
  dim Temp
  Temp = GetTriggerInfo("SkillHlt", 1) 'Get match text.
  dim p1, p2, T1, T2, T3
  p1 = instr(Temp, "(")
  p2 = instr(Temp, ")")
  T1 = left(Temp, p1)                  'Get the first bit.
  if p2 - p1 - 1 > 0 then
  T2 = mid(Temp, p1 + 1, p2 - p1 - 1) 'Get our list of skills.
else
  T2 = ""
end if
  T3 = right(Temp, len(Temp) - p2 + 1) 'Get the last bit.
  dim fnd
  fnd = 0
  if T2 = "" then 'No skills, so just add it.
    T2 = wilds(1)
  else
    dim Skills, count
    Skills = split(T2,"|") 'Split into an array then check if already in list.
    for count = 0 to ubound(Skills) 'Loop through all the skills we have in the list.
      if Skills(count) = wilds(1) then
        fnd = 1
      end if
    next
    if fnd = 0 then
      T2 = T2 + "|" + wilds(1)
    else
      world.colournote "red", "black", "That skill is already being tested for."
      world.note " "
    end if
  end if
  if fnd = 0 then
    world.addtrigger "SkillHlt", T1 & T2 & T3, "", 1065, tcolor, 1, "", ""
    world.note wilds(1) & " added to highlighting list."
    world.note " "
  end if
end sub

'This is for everyone
sub Remskill(aname, output, wilds)
if wilds(1) = "list" or wilds(1) = "train" then
exit sub
end if
  dim tcolor
  tcolor = 1 'Change this to the custom color you use. 
  dim Temp
  Temp = GetTriggerInfo("SkillHlt", 1)
  dim p1, p2, T1, T2, T3
  p1 = instr(Temp, "(")
  p2 = instr(Temp, ")")
  T1 = left(Temp, p1)
  if p2 - p1 - 1 > 0 then
  T2 = mid(Temp, p1 + 1, p2 - p1 - 1) 'Get our list of skills.
else
  T2 = ""
end if
  T3 = right(Temp, len(Temp) - p2 + 1)
  if T2 > "" then
    dim Skills, count, fnd
    Skills = split(T2,"|")
    fnd = 0
    for count = 0 to ubound(Skills)
      if Skills(count) <> wilds(1) then
        if count > 0 then
          T2 = T2 + "|" + Skills(count)
        else
          T2 = Skills(count)
        end if
      else
        fnd = 1
      end if
    next
    if fnd = 1 then
      world.addtrigger "SkillHlt", T1 & T2 & T3, "", 1065, tcolor, 0, "", ""
      world.note wilds(1) & " successfully removed."
      world.note " "
    else
      world.colournote "red", "black", wilds(1) & " not found in list."
      world.note " "
    end if
  else
    world.colournote "red", "black", "There are no skills to remove."
    world.note " "
  end if
end sub

'This is for everyone
sub ListHlt (aname, output, wilds)
  Temp = GetTriggerInfo("SkillHlt", 1)
  dim p1, p2, T1, T2, T3
  p1 = instr(Temp, "(")
  p2 = instr(Temp, ")")
  T2 = mid(Temp, p1 + 1, p2 - p1 - 1)
  if T2 = "" then
    world.note "Nothing to list."
  else
    dim count, Skills
    Skills = split(T2, "|")
    for count = 0 to ubound(Skills)
      world.tell Skills(count) & space(20 - len(Skills(count)))
      if (count + 1)/3 = int((count + 1)/3) then 'This gives us 3 skills per line when displayed.
        world.note " "
      end if
    next
    world.note " "
	end if
end sub


This works fairly well, this is one bug in it, and i can't find it.

When you gain a skill or remove a skill, it "doubles" all the skills left in the trigger.

My code(with a LOT of Nicks help) to fame:

sub OnAutoCombo (TriggerName, TriggerLine, arrWildCards)
dim AutoCombo
AutoCombo = split (arrWildCards (1))
Dim i, attack
for i=lbound (AutoCombo ) to ubound (AutoCombo )
Select Case AutoCombo (i)
case "rp" attack = "punch right"
case "lp" attack = "punch left"
case "s" attack = "sweep"
case "r" attack = "roundhouse"
case else attack = "" ' unknown attack type
End Select
if i = ubound (AutoCombo ) then
world.send "throw " + world.getvariable ("attacker") + " down"
else
world.send attack + " " + world.GetVariable ("attacker")
end if
next
end sub
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Fri 23 May 2003 04:25 AM (UTC)
Message
After adding the trigger, do this:


world.SetTriggerOption "SkillHlt", "repeat", "1"

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by David B   USA  (80 posts)  Bio
Date Reply #2 on Fri 23 May 2003 05:07 AM (UTC)
Message
That worked Perfectly, you responded before I finished my addmendum, i apologize.

My code(with a LOT of Nicks help) to fame:

sub OnAutoCombo (TriggerName, TriggerLine, arrWildCards)
dim AutoCombo
AutoCombo = split (arrWildCards (1))
Dim i, attack
for i=lbound (AutoCombo ) to ubound (AutoCombo )
Select Case AutoCombo (i)
case "rp" attack = "punch right"
case "lp" attack = "punch left"
case "s" attack = "sweep"
case "r" attack = "roundhouse"
case else attack = "" ' unknown attack type
End Select
if i = ubound (AutoCombo ) then
world.send "throw " + world.getvariable ("attacker") + " down"
else
world.send attack + " " + world.GetVariable ("attacker")
end if
next
end sub
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.


13,641 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.