[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Jscript
. . -> [Subject]  Math - Adding and stuff.

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Math - Adding and stuff.
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Pages: 1 2  

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Sun 29 Jul 2007 10:43 PM (UTC)  quote  ]
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
[Go to top] top

Posted by Helpless   (27 posts)  [Biography] bio
Date Sun 29 Jul 2007 09:53 PM (UTC)  quote  ]
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" ) (
[Go to top] top

Posted by Shaun Biggs   USA  (644 posts)  [Biography] bio
Date Sun 29 Jul 2007 06:21 AM (UTC)  quote  ]
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.
[Go to top] top

Posted by Helpless   (27 posts)  [Biography] bio
Date Sun 29 Jul 2007 02:05 AM (UTC)  quote  ]
Message
Expected ';'
Line in error:
for (i = 1; i <= world.GetInfo(224), i++) {

remember, its suppose to be JScript ;)
[Go to top] top

Posted by Shaun Biggs   USA  (644 posts)  [Biography] bio
Date Sat 28 Jul 2007 11:49 PM (UTC)  quote  ]
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.
[Go to top] top

Posted by Helpless   (27 posts)  [Biography] bio
Date Sat 28 Jul 2007 06:38 PM (UTC)  quote  ]

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

Message
Expected '('
Line in error:
for i = 1 to world.GetInfo(224) {
[Go to top] top

Posted by Shaun Biggs   USA  (644 posts)  [Biography] bio
Date Sat 28 Jul 2007 05:49 AM (UTC)  quote  ]
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.
[Go to top] top

Posted by Helpless   (27 posts)  [Biography] bio
Date Sat 28 Jul 2007 03:25 AM (UTC)  quote  ]
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)
[Go to top] top

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Tue 24 Jul 2007 09:27 PM (UTC)  quote  ]
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
[Go to top] top

Posted by Shaun Biggs   USA  (644 posts)  [Biography] bio
Date Tue 24 Jul 2007 07:28 PM (UTC)  quote  ]
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.
[Go to top] top

Posted by Helpless   (27 posts)  [Biography] bio
Date Tue 24 Jul 2007 05:57 PM (UTC)  quote  ]
Message
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.
[Go to top] top

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Tue 17 Jul 2007 08:26 PM (UTC)  quote  ]
Message
See this post:

http://www.gammon.com.au/forum/bbshowpost.php?id=6664

It could something to do with having to change your "plugins" folder in global configuration from a relative path to an absolute path.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Shaun Biggs   USA  (644 posts)  [Biography] bio
Date Tue 17 Jul 2007 05:28 PM (UTC)  quote  ]
Message
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

It is much easier to fight for one's ideals than to live up to them.
[Go to top] top

Posted by Helpless   (27 posts)  [Biography] bio
Date Tue 17 Jul 2007 01:45 PM (UTC)  quote  ]
Message
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Monday, April 30, 2007, 12:02 PM -->
<!-- MuClient version 4.01 -->

<!-- Plugin "afestiv" generated by Plugin Wizard -->

<muclient>
<plugin
name="AddThem"
id="a9dea92c93314180d3e365cc"
language="JScript"
date_written="2007-04-30 12:01:37"
purpose="add it"
requires="4.01"
save_state = "y"
version="1.0"
>

</plugin>

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.
[Go to top] top

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Tue 17 Jul 2007 05:39 AM (UTC)  quote  ]
Message
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"
  >

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] 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.


6,653 views.

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

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]