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 ➜ Miniwindows ➜ Quest Miniwindow for balzhur

Quest Miniwindow for balzhur

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


Posted by Deckard   (6 posts)  Bio
Date Tue 07 Apr 2020 05:32 PM (UTC)
Message
Hi there!
I've tried to modify the plugin from here:
http://www.gammon.com.au/forum/?id=8814 in order to make it works on Balzhur. But... it's not working. So I came here to beg some help :)

In Balzhur, @questman can have four or five different names depending where you are. So, it's not possible to use a single @questor o @questman name...

I hope maybe if I use (name1|name2|name3|name4) should works... what do you thing?

This is what questman says to you when you ask for a quest (first and last phrase):

El reclutador te cuenta 'Gracias valiente Deckard!'

El reclutador te cuenta 'Que los dioses vayan contigo!'

I hope you can help me.
Thnx!
Best!
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #1 on Tue 07 Apr 2020 08:19 PM (UTC)
Message
@questor is a variable, not a name.

When the plugin sees:


match="You ask * for a quest."


Then that wildcard becomes the current quest giver (until it sees that another time).

So in your case your questor seems to be "El reclutador" (the recruiter) so your trigger would be:


* te cuenta 'Gracias valiente *!'


Now the variable "questor" becomes "El reclutador" and the other parts should work.

Of course, you need to translate the other triggers as well.

- Nick Gammon

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

Posted by Deckard   (6 posts)  Bio
Date Reply #2 on Wed 08 Apr 2020 04:35 AM (UTC)
Message
Hi there!
Thnx Nick!

This is what I try:

https://github.com/DeckardCod/Mushclient/blob/master/Quest%20Tracker

And... this is what it shows :-s

https://prnt.sc/rv60ox

Sorry, i've tried to paste the code here but it seems be to long :-s
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #3 on Wed 08 Apr 2020 05:05 AM (UTC)
Message
Can you please copy and paste the MUD output here, don't take a screenshot of it.

If you paste it I can try out your plugin. I don't plan to retype dozens of lines from an image.

- Nick Gammon

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

Posted by Deckard   (6 posts)  Bio
Date Reply #4 on Wed 08 Apr 2020 06:23 AM (UTC)
Message
Hi there!
Sure, here we are:

Pides a el reclutador un nuevo quest.

El reclutador te cuenta 'Gracias valiente Deckard!'


El reclutador te cuenta 'encontre un extranyo mapa'

El reclutador te cuenta 'Quiero que lo uses para llegar al lugar que indica'

El reclutador te cuenta 'investiga si esconde algun tesoro'
Encuentra el tesoro en el area Haon Dor, (reino de Calimhar).
El reclutador te cuenta 'El mapa es de Haon Dor, Reino de Calimhar, no pierdas mas tiempo!'
Tienes 28 minutos.
El reclutador te cuenta 'Tienes 28 minutos para realizar la mision'

El reclutador te cuenta 'Que los dioses te bendigan!'
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #5 on Thu 09 Apr 2020 03:42 AM (UTC)
Message
Your trigger here is not enabled:


 <trigger
   match="* te cuenta '*'"
   name="questor_line"
   script="questor_line"
   sequence="100"
   expand_variables="y"
  >


Therefore it won't notice you asking for a quest.

- Nick Gammon

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

Posted by Deckard   (6 posts)  Bio
Date Reply #6 on Thu 09 Apr 2020 04:44 AM (UTC)

Amended on Thu 09 Apr 2020 05:13 AM (UTC) by Deckard

Message
Hi there!


Ok, the trigger has been enabled.
But still happen the same. Shows the info by half: the mini window shows several lines which it says: "el reclutador", as if only the text of the first * is loaded, it's seems like the second * it's ignored.




<!--  Triggers  -->

<triggers>

  <trigger
   enabled="y"
   match="* te cuenta '*'"
   name="questor_line"
   script="questor_line"
   sequence="100"
   expand_variables="y"
  >
  </trigger>
  
  <trigger
   enabled="y"
   match="Pides * un nuevo quest."
   script="start_questor_stuff"
   sequence="100"
  >
  </trigger>
  
  <trigger
   enabled="y"
   match="* te cuenta 'Tienes * minutos para realizar la mision'"
   name="questor_end"
   script="questor_end"
   sequence="10"
   expand_variables="y"
  >
  </trigger>
  
 <trigger
   enabled="y"
   match="Has completado tu QUEST!"
   sequence="100"
   script="quest_done"
  >
  </trigger>

 <trigger
   enabled="y"
   match="* dice 'Ve al Questman y muestrale mi gratitud por su generosa bondad'"
   sequence="100"
   script="quest_done"
  >
  </trigger>


 <trigger
   enabled="y"
   match="Le dices a * que ya has completado su quest."
   sequence="100"
   script="quest_handed_in"
  >
  </trigger>
  
 <trigger
   enabled="y"
   match="'Intentalo de nuevo dentro de * minutos'"
   sequence="100"
   script="quest_time_to_go"
  >
  </trigger>

 <trigger
   enabled="y"
   match="Ya puedes volver a pedir un quest."
   sequence="100"
   script="quest_available"
  >
  </trigger>

  <trigger
   enabled="y"
   match="You do not have to wait to go on another quest."
   sequence="100"
   script="quest_available"
  >
  </trigger>
     
</triggers>


I follow this steps:
1) enable the trigger.
2) re-install the plugin.

Best!
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #7 on Thu 09 Apr 2020 08:58 PM (UTC)

Amended on Thu 09 Apr 2020 09:18 PM (UTC) by Nick Gammon

Message
Around line 180, change:


function questor_line (name, line, wildcards)
  local text = wildcards [1]


to:


function questor_line (name, line, wildcards)
  local text = line


That fixes the issue with the short lines.

Or, maybe:


function questor_line (name, line, wildcards)
  local text = wildcards [2]





Further down, change:


 local days = string.match (text, "(%d+) days?")
  if days then
    when_required = when_required + tonumber (days) * 60 * 60 * 24
  end -- some days left

  local hours = string.match (text, "(%d+) hours?")
  if hours then
    when_required = when_required + tonumber (hours) * 60 * 60
  end -- some days left

  local minutes = string.match (text, "(%d+) minutes?")
  if minutes then
    when_required = when_required + tonumber (minutes) * 60
  end -- some days left



... to match the Spanish. (eg. "minutos?" rather than "minutes?").




These are not proper Lua patterns:


  if string.match (text, "'*Gracias valiente *!'") then
    return
  end -- if

  if string.match (text, "'*Que los dioses vayan contigo!'") then
    return
  end -- if


You have used MUSHclient wildcards rather than Lua patterns. It should be:


  if string.match (text, "'Gracias valiente .*!'") then
    return
  end -- if

  if string.match (text, "'Que los dioses vayan contigo!'") then
    return
  end -- if

- Nick Gammon

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

Posted by Deckard   (6 posts)  Bio
Date Reply #8 on Fri 10 Apr 2020 03:49 PM (UTC)
Message
Hi there


function questor_line (name, line, wildcards)
  local text = wildcards [1]


When I change this, some issues as appear with all other mobs. So I kept it the same way.

I fixed using this code:

    <trigger
   enabled="y"
   match="El reclutador te cuenta '*'"
   name="questor_line"
   script="questor_line"
   sequence="100"
   expand_variables="y"
  >
  </trigger>


I also changed the hours, minutes and senconds to spanish:

  local days = string.match (text, "(%d+) dias?")
  if days then
    when_required = when_required + tonumber (dias) * 60 * 60 * 24
  end -- some days left
  
  local hours = string.match (text, "(%d+) horas?")  
  if hours then
    when_required = when_required + tonumber (horas) * 60 * 60
  end -- some days left

  local minutes = string.match (text, "(%d+) minutos?")  
  if minutes then
    when_required = when_required + tonumber (minutos) * 60
  end -- some days left



But, now, the miniwindow shows all the text but open and close too quickly... :-s like a blink :(
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #9 on Fri 10 Apr 2020 09:22 PM (UTC)
Message

 local days = string.match (text, "(%d+) dias?")
  if days then
    when_required = when_required + tonumber (dias) * 60 * 60 * 24
  end -- some days left


You haven't been consistent with your variable names.


local days = ...
      ^^^^

... tonumber (dias) ...
              ^^^^


These are variables, you don't need to translate them. But if you do, you need to be consistent. eg.


  local dias = string.match (text, "(%d+) dias?")
  if dias then
    when_required = when_required + tonumber (dias) * 60 * 60 * 24
  end -- some days left

- Nick Gammon

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

Posted by Deckard   (6 posts)  Bio
Date Reply #10 on Sat 11 Apr 2020 11:02 AM (UTC)
Message
Hi there!

Changed! but is not working :(



function questor_end (name, line, wildcards)

  local text = wildcards [1]
  
   -- work out when quest ends
  
  when_required = os.time ()
  
  local dias = string.match (text, "(%d+) dias?")
  if dias then
    when_required = when_required + tonumber (dias) * 60 * 60 * 24
  end -- some days left
  
  local horas = string.match (text, "(%d+) horas?")  
  if horas then
    when_required = when_required + tonumber (horas) * 60 * 60
  end -- some days left

  local minutos = string.match (text, "(%d+) minutos?")  
  if minutos then
    when_required = when_required + tonumber (minutos) * 60
  end -- some days left
 
  check (EnableTrigger ("questor_line", false))
  check (EnableTrigger ("questor_end", false))
  show_quest_text ()
end -- questor_end


function show_quest_text ()

  if #quest_info == 0 and 
    next_quest_time then
    show_when_quest_available ()
    return
  end -- one available now/soon
                 
  -- do nothing if no quest
  if #quest_info == 0 or when_required == nil then
    return
  end -- if

  -- recreate the window the correct size
  WindowCreate (win, 
               0, 0,   -- left, top (auto-positions)
               max_width + 10,     -- width
               (#quest_info + 2) * font_height + 5,  -- height
               8,       -- auto-position: top middle
               0,  -- flags
               0xE7FFFF) 

  -- heading
  local text = "Current quest."
  Display_Line (1, text, font_id, heading_colour)

  -- list of mobs
  for i, v in ipairs (quest_info) do
    Display_Line (i + 1, v, font_id, text_colour)
  end -- for
  
  -- how long to go
  local time_to_go = when_required - os.time ()
  
  if time_to_go < 0 then
    return
  end -- if
  
  text = string.format ("Time to go: %s", convert_time (time_to_go))
  Display_Line (#quest_info + 2, text, font_id, time_colour)
    
  WindowShow (win, true)
    
end -- show_quest_text


  <trigger
   enabled="y"
   match="El reclutador te cuenta 'Tienes * minutos para realizar la mision'"
   name="questor_end"
   script="questor_end"
   sequence="10"
   expand_variables="y"
  >
  </trigger>


Best
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #11 on Wed 15 Apr 2020 07:12 AM (UTC)
Message
What do you mean "not working"? Can you be specific? What did you expect to happen, and what actually happened?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


26,392 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.