Okay, I have read some more and played around with some things, and I think I'm going to need quite a bit of help. I have tried to make a simplified version of what my ideal script should do first, with a textfile having 1 line that gets overwritten by a '!set xxxxx' command and read with '!nextmatch'.
I have created two Event triggers: OnchannelMessage
I created an empty file in my kvirc folder (home/username/.config/kvirc/matches.txt)
The event triggers currently read:
if ($3 == "!set" && $chan.name == "#doorn" ) {
$file.writeLines <filename:$file.localdir/matches.txt> <lines:1> "$3";
}
if ($3 == "!nextmatch" && $chan.name == "#doorn" ) {
<array> $file.readLines(<filename:$file.localdir/matches.txt>[,<startline:1>,[<count:1>]])
echo $file.readLines(/proc/cpuinfo);
}
Obviously, this doesn't work. I know of a few things that I do wrong.
1. '!set' is not the parameter I want the code to respond to. It should be respond to: '!set xxxxxxxxxxxxxxxxx' where x is a wildcard.
2. I'm not really sure if I use $file.write correctly.
3. The message I want to write to line 1 of the file is not '$3'. It's $3 where the !set is stripped out.
4. I am unsure whether I use the $file.readLines command right.
5. I obviously do not get the desired endresult because of all points mentioned above.
the problem is that everything I do at the moment is a guessing game. I simply don't understand what I'm doing, or should be doing.