[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Another thing....

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Another thing....

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by David B   USA  (80 posts)  [Biography] bio
Date Fri 23 May 2003 03:47 AM (UTC)  quote  ]

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
[Go to top] top

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Fri 23 May 2003 04:25 AM (UTC)  quote  ]
Message
After adding the trigger, do this:


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

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by David B   USA  (80 posts)  [Biography] bio
Date Reply #2 on Fri 23 May 2003 05:07 AM (UTC)  quote  ]
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
[Go to top] 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.


1,598 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]