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 ➜ Jscript ➜ Math - Adding and stuff.

Math - Adding and stuff.

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


Pages: 1  2 

Posted by Shaun Biggs   USA  (644 posts)  Bio
Date Reply #15 on Tue 24 Jul 2007 07:28 PM (UTC)
Message
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

It is much easier to fight for one's ideals than to live up to them.
Top

Posted by Nick Gammon   Australia  (23,169 posts)  Bio   Forum Administrator
Date Reply #16 on Tue 24 Jul 2007 09:27 PM (UTC)
Message
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.

- Nick Gammon

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

Posted by Helpless   (48 posts)  Bio
Date Reply #17 on Sat 28 Jul 2007 03:25 AM (UTC)
Message
Expected 'To'
Line in error:
for i = 1,GetInfo(224) do

i keep getting that error using what you said.

but i never knew about the Recall Text thing, thanks Nick (and Shaun for trying)
Top

Posted by Shaun Biggs   USA  (644 posts)  Bio
Date Reply #18 on Sat 28 Jul 2007 05:49 AM (UTC)
Message
Sorry, should have mentioned that the script was for Lua. I completely missed that this was in the Jscript forum.

for i = 1 to world.GetInfo(224) {
  if world.GetLineInfo(i, 1).indexOf( "wordtofind" ) {
    world.AppendToNotepad( "findlines", GetLineInfo(i,1) + "\n" )
  }
world.SaveNotepad( "findlines", "C:\filename" )

Also fixed a few mistakes I had made, like forgetting to put a line break at the end of each line.

It is much easier to fight for one's ideals than to live up to them.
Top

Posted by Helpless   (48 posts)  Bio
Date Reply #19 on Sat 28 Jul 2007 06:38 PM (UTC)

Amended on Sat 28 Jul 2007 07:31 PM (UTC) by Helpless

Message
Expected '('
Line in error:
for i = 1 to world.GetInfo(224) {
Top

Posted by Shaun Biggs   USA  (644 posts)  Bio
Date Reply #20 on Sat 28 Jul 2007 11:49 PM (UTC)
Message
At some point I'll remember what language I'm trying to deal with.

for (i = 1; i <= world.GetInfo(224), i++) {
  if world.GetLineInfo(i, 1).indexOf( "wordtofind" ) {
    world.AppendToNotepad( "findlines", GetLineInfo(i,1) + "\n" )
  }
world.SaveNotepad( "findlines", "C:\filename" )


It is much easier to fight for one's ideals than to live up to them.
Top

Posted by Helpless   (48 posts)  Bio
Date Reply #21 on Sun 29 Jul 2007 02:05 AM (UTC)
Message
Expected ';'
Line in error:
for (i = 1; i <= world.GetInfo(224), i++) {

remember, its suppose to be JScript ;)
Top

Posted by Shaun Biggs   USA  (644 posts)  Bio
Date Reply #22 on Sun 29 Jul 2007 06:21 AM (UTC)
Message
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.

It is much easier to fight for one's ideals than to live up to them.
Top

Posted by Helpless   (48 posts)  Bio
Date Reply #23 on Sun 29 Jul 2007 09:53 PM (UTC)
Message
its not like the errors scream out "replace this with this". its only "expected this" and then shows you the line with an error....so helpful.


Expected '('
Line in error:
if world.GetLineInfo(i, 1).indexOf( "wordtofind" ) (
Top

Posted by Nick Gammon   Australia  (23,169 posts)  Bio   Forum Administrator
Date Reply #24 on Sun 29 Jul 2007 10:43 PM (UTC)
Message
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.

- 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.


86,888 views.

This is page 2, subject is 2 pages long:  [Previous page]  1  2 

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.