Gammon Forum
Entire forum
MUSHclient
Lua
Mission point Counter?
It is now over 60 days since the last post. This thread is closed.
 
Refresh page
Posted by
| Biran
(8 posts) bio
|
Date
| Fri 13 Jan 2023 05:51 PM (UTC) |
Message
| I'm new to this type of script and iv looked into the forum for something similar but have had little luck getting it to work.
This is the trigger line.
Raichek says 'As a reward, I am giving you 18 mission points, and 14 Ryo.'
Trigger:
match="^'As a reward, I am giving you (\d+) mission points, and (\d+) Ryo.'$"
Send:
var.mpcount = (var.mpcount or 0) + %1
var.totmp = (var.totmp or 0) + %1
I have it going to script,enabled, regular expression,custom_2
Also my lua file is C:\Program Files (x86)\MUSHclient\scripts\exampscript.lua
My alias recall this number is
Alias = missions
You have gained : @mpcount
It gives the Error variable "mpcount" has not been defined | top |
|
Posted by
| AdInfinitum
(74 posts) bio
|
Date
| Reply #1 on Fri 13 Jan 2023 08:58 PM (UTC) Amended on Mon 16 Jan 2023 12:52 PM (UTC) by AdInfinitum
|
Message
| A couple things to check:
1. Your script contains require 'var', right?
2. Did you enable 'Expand Variables' in the alias? | top |
|
Posted by
| Biran
(8 posts) bio
|
Date
| Reply #2 on Fri 13 Jan 2023 09:55 PM (UTC) |
Message
|
AdInfinitum said:
A couple things to check:
1. Your script contains requires 'var', right?
2. Did you enable 'Expand Variables' in the alias?
I have expanded variables on the alias but I don't have Require var...what would that look like? in the send area or is that a click option?
Thank you for the quick response! i have this trigger that collects sends everything to notepad but having them auto-totaled up would be so much better. | top |
|
Posted by
| Nick Gammon
Australia (22,928 posts) bio
Forum Administrator |
Date
| Reply #4 on Sun 15 Jan 2023 01:46 AM (UTC) |
Message
| There are examples of using "var" in this post:
http://www.gammon.com.au/forum/?id=4904&reply=6#reply6
That shows using the "require" statement.
Also, if you don't need to keep the counts over multiple sessions (you might) then simple Lua variables will do, they would reset each time you started the client. |
- 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.
3,586 views.
It is now over 60 days since the last post. This thread is closed.
 
Refresh page
top
Quick links:
MUSHclient.
MUSHclient help.
Forum shortcuts.
Posting templates.
Lua modules.
Lua documentation.
Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.