0

in my MIRC script, it is set up to read a text file, in these text files there is the symbol " | " followed by a space on both ends, it seems to read everything before " | " just fine, but cuts it off right at the first space. Any help is appreciated.

I am using

msg $nick $read(test.txt, n, 1)

to read the text file.

EDIT:: I have tried all switches which result in the same thing.

EDIT:: It also tells me in the server window "Unknown Command"

EDIT:: After making a new pastebin uploading script, it still seems to get that issue? It will completely just cut off the rest of the text after a "&" or " | "

skdfsfwse
  • 19
  • 7
  • It's working well for me, try checking if you really have `some text | some other text` on the actual file. – Orel Eraki Jul 27 '16 at 06:58
  • well, there is multiple " | " inside the same line, heres an example from the text file.           `abcd : 26/07/2016   ::efgh::  ijklmn  |  opqrst | uvwxyz 2382` – skdfsfwse Jul 27 '16 at 17:06
  • Are you sure you're not using `(test.txt, np, 1)` ? – Orel Eraki Jul 27 '16 at 17:28
  • @OrelEraki Yes... I am sure. Have you been able to recreate my situation? Let me be more specific of what is returned to me... `abcd : 26/07/2016 ::efgh:: ijklmn | opqrst` – skdfsfwse Jul 27 '16 at 17:30
  • Write at any window: `//echo -ag $read(test.txt, n, 1)`, does it show the entire line ? – Orel Eraki Jul 27 '16 at 17:33
  • @OrelEraki yes, it shows the entire line. – skdfsfwse Jul 27 '16 at 17:35
  • Yup.. As i suspected, you got some `on *:INPUT:` event, which is evaluating those lines as commands. try disabled all those inputs to `OFF` instead of `ON` and then test it. – Orel Eraki Jul 27 '16 at 17:36
  • @OrelEraki Now It doesn't even trigger the read command – skdfsfwse Jul 27 '16 at 17:41
  • I think you messed the script a bit. publish at some Pastie site the ENTIRE script file from top to bottom(just the specific file). – Orel Eraki Jul 27 '16 at 17:46
  • http://pastebin.com/5HN3N8Es – skdfsfwse Jul 27 '16 at 17:50
  • That's the entire remote file ? – Orel Eraki Jul 27 '16 at 17:52
  • @OrelEraki Oh no, the remote file is like 400 + lines I'd rather not upload all of it – skdfsfwse Jul 27 '16 at 17:53
  • I will need it, you got some curly brackets you didn't close which effecting your other scripts. Don't worry no one will still your code. You can also remove the link after 5 minutes. – Orel Eraki Jul 27 '16 at 17:57
  • That's not the issue, every line of my script works except the one, all curly brackets are also closed. i have also tested it on a new script.ini file.... – skdfsfwse Jul 27 '16 at 18:05
  • Hardly doubt it, you can extract the little snippet(short script) of *!test* to a new remote file and it will work. (But! you will still have issues on other parts of the script file) – Orel Eraki Jul 27 '16 at 18:08
  • @OrelEraki I told you I have also tested a new remote file. EDIT:: Are we not able to do the entire line as //echo did? – skdfsfwse Jul 27 '16 at 18:10
  • Are you interfering with `msg` alias ? or with `ParseLine` ? try disabling them as well. – Orel Eraki Jul 27 '16 at 18:16
  • @OrelEraki I cannot disable interfering with parseline because it is one of the main features that needs to work. Any ideas on solving this without ruining the functionality? – skdfsfwse Jul 27 '16 at 18:31
  • Is it really impossible for you to unload all your scripts for a minute to test if any of your current scripts are interfering with the $read/your input? – Denny Jul 29 '16 at 11:50
  • I did that... @denny I left one script which i posted below. http://pastebin.com/8x0E0sAv – skdfsfwse Jul 30 '16 at 18:53
  • I cannot tell from your reactions that you've tried that. And reading text files with a pipe in it works also fine for me. – Denny Jul 30 '16 at 21:33

3 Answers3

0

The symptoms is matching to a scenario which $read was evaluated to a command and the result will take the separators as set of commands to be executed.

This can be due to aliases or events.

Try the first /play command, which will play the file from the 3rd line to see if it behaving as the line we expect it to be or instead each line as a set of commands, separated by /
Then perform the 2nd /play command to view how it should been send to the server.

This is design to see where the problem lie.

/play -axl3 echo test.txt
/play -exl3 test.txt

The output should be the same and as we expect it with the line being displayed including |.

This will make sure the problem is to blame upon other corrupt aliases or events.

We will perform the following and after each step you will test you code to see if it was solved.

  1. Test to see if it an alias named msg hurt you, by converting your script command to /!msg $nick$read(test.txt, n, 1).
  2. Check for dangerous events such as the infamous INPUT or the rising bandit PARSELINE by disabling them.
    If the problem solved then return the events one by one the find the problematic event and fix it.
Orel Eraki
  • 11,940
  • 3
  • 28
  • 36
  • I am currently using this script here which plays with the parseline, I need this in order for my entire IRC bot to function. http://pastebin.com/8x0E0sAv – skdfsfwse Jul 28 '16 at 04:35
  • Please read the entire answer and tell me where exactly is the problem lies. – Orel Eraki Jul 28 '16 at 08:45
  • I have no aliases in my script, play gave the correct output, i have tested it with no other events aside from that script i have posted above... I'm not understanding what else you want me to do? – skdfsfwse Jul 28 '16 at 13:53
  • Alright after rereading it a bunch of times hoping to find a solution, all I can say is when I play using the 2 ways you showed me, they both show the correct text. – skdfsfwse Jul 28 '16 at 19:15
  • You're wishing to catch a `private message` or a `describe` ? if so your event should be `:ACTION:` instead of a `:TEXT:`. – Orel Eraki Jul 28 '16 at 22:25
  • Im trying to catch text, the private message is turned into a private query in that script I pasted above. @oreleraki – skdfsfwse Jul 28 '16 at 22:36
0

Due to the lack of a responses/answers, I was unable to solve it, I have made a makeshift fix for this issue by using

play -xl# $nick test.txt

rather than

msg $nick $read(test.txt, n, 1)
skdfsfwse
  • 19
  • 7
0

I had almost the same problem and was able to solve it, using the same solution, try this:

Your previous script was: msg $nick $read(test.txt, n, 1) Now remove the 'msg $nick' and add that to the beginning of every line in the text.txt file with a space between 'msg $nick' and the rest of the line, i.e : msg $nick Hey I see you are back | msg $nick Missed You!

Then your script becomes: $read(test.txt, p)

^^ Hope that makes sense, but I found the original issues was Double Evaluation hence why sometimes you would see the error: Unknown Command or something along those lines.

newklear
  • 21
  • 6