You won 20 implementor tokens!
You won 4000 questpoints!
You won 40 immortal tokens!
You win a (Diamond) scratch card!
You won 60 trains!
No matches! You lose! Better luck next time!
Those are some of the things I can win from a card.
I want to be able to turn the calculator on when i start scratching (and it would like...save them somewhere/somehow), then have a alias (manually operated) to sum up everything I have won when im done, and how many times I have lost of course. I've downloaded a script to calculate stuff for something different and I tried to understand it, but I just dont.
Here's where some wildcars or variables would go if you use them:
You won * implementor tokens!
You won * questpoints!
You won * immortal tokens!
You win a * scratch card!
You won * trains!
Example of it reporting:
say You have won X imps, X qps, X imms, X cards, X trains, and lost X amount of times so far.
----------------------------------------------------
Also want an alias to be able to reset all totals to 0 if possible.
If someone could code this for me please...or give me a huge huge huge huge huge huge omega hint on how to do it myself without mind numbing reading...that could be good too.
Make variables for each statistic you want to track. Have the trigger capture whatever is in the line and add it to that variable. Also, make sure to double check and make sure that the variables are actually there and that you convert them into numbers before trying to add them together. For example, in the trigger that matches "You won * implementor tokens!" you would have this in the send to script part:
what about an alias to report how many of each I have won so far? and with the stuff you posted, is it already summing them up each time i win X of "whatever"?
maybe if you could show me a script that works with just one of the variables i want, i can move on from there?
is there a way to make it count how many times I win cards? unfortunately its not a number. I'd also like one for counting how many times I lose please. Thanks for all your help so far :)
Do the same thing with +1 instead of +wildcards[0]. If there are multiple types of cards, then just name the variable as the card type name, and have the following:
<triggers>
<trigger
enabled="y"
match="You win a (*) scratch card!"
send_to="12"
sequence="100"
>
<send>
cards = world.GetVariable ("%1");
// first time variable won't exist
if (cards == null)
cards = "0";
// save for later
world.SetVariable ("%1", parseInt (cards) + 1)
// note to screen
Note ("You have won " + world.GetVariable ("%1") + " %1 cards so far")
</send>
</trigger>
</triggers>
I really hope I got the right version of %1 in there. I can never remember when I need a set of quotes around those.
I would need to see your whole plugin header to answer that. Is this a plugin you are talking about? Edit one of the existing ones to see how that is used. For example:
<muclient>
<plugin name="Random_Socials"
author="Nick Gammon"
language="Lua"
id = "e032b4b7db80da78a87dc708"
purpose = "Displays a random social from time to time"
save_state = "y"
date_written="2007-05-03 09:30"
requires="3.80"
version = "1.0"
>
thats what it looks like.
keeps saying "Unable to create the plugin save state file".
Its always said this as far as i know, and I know that taking out the save_state line wont give me an error but it also wont save either im sure.
Double check your MUSHclient/worlds/plugins/state folder. Make sure it exists, and that you have permission to edit files there. If you do, try matching your worldid-pluginid to a savestate and delete that. Sometimes starting over like that can help.
For instance, if I installed a plugin with the id you just listed into my main world file, I would see this file:
4f290293a1feabfdc0be9e26-a9dea92c93314180d3e365cc-state.xml
Is there a way to capture a word from the buffer and have it write to a file the exact line containing that particular word? If it can only be captured "as I go" then thats fine too, but looking for a way to capture the line with the word thats in my buffer already.
It's probably easiest to just match the lines as they come in. You can have a trigger copy the line into a notepad file within MUSHclient.
You can search the output buffer and grab every line with something like this:
for i = 1,GetInfo(224) do
if string.find(GetLineInfo(i).text, "wordtofind") then
AppendToNotepad( "findlines", GetLineInfo(i).text )
end
SaveNotepad( "findlines", "C:\filename" )
end
The Display menu -> Recall Text can be used to search the output buffer for a word or text that is already there. Matching lines are written to a separate window, which can then be saved as a file.
If you can't fix the typo of a comma needing to be a semicolon, maybe you should pick a language that you are familiar with and run with that. There are several tutorials for pretty much any language you could hope to look for. I've noticed a few errors with the javascript part I jotted down real quickly because I couldn't currently test it on my normal machine. I haven't bothered to try and get javascript running through wine after my last install.
The problem is, the compiler doesn't really know what you intended, once you break the rules of the language.
Let's take a simple example:
a = b c
Gives error:
Expected ';'
Line in error:
a = b c
Now there are quite a few things you might have meant, so the compiler can't really say "replace this with that". Here are some examples of what you might have meant:
a = bc // added a space by mistake
a = b + c // left out arithmetic operator
a = b - c
a = b / c
a = b * c
a = b (c) // meant to call function
The intention of the error message is to look at the line in error (and sometimes the previous line is really the problem line), and, using your knowledge of the language, work out what is wrong.