Another thing....

Posted by David B on Fri 23 May 2003 03:47 AM — 3 posts, 14,352 views.

USA #0
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.
Amended on Fri 23 May 2003 04:31 AM by David B
Australia Forum Administrator #1
After adding the trigger, do this:


world.SetTriggerOption "SkillHlt", "repeat", "1"
USA #2
That worked Perfectly, you responded before I finished my addmendum, i apologize.