Error with a not useful message.

O

OxO pHz.60

------=_Part_747_3014172.1125498436044
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

hi when i try to run this ruby script (a mud client for angalon) y get the=
=20
following error

rorschach@pirata ~/Sources/ainamc $ ruby ainamc.rb
ainamc.rb:125: syntax error
Gtk.main
^

i have no idea what the error might be, i with post all code here:

require 'gtk2'
require 'net/telnet'

class Mud

attr_accessor :host, :port, :mud

def initialize( host, port =3D 23 )
@host =3D host
@port =3D port
end

def add_mud( host , port )
if @host !=3D nil
@Mud =3D Net::Telnet::new( { "host" =3D> @host , "port" =3D> @port } )
end
end

end

#todo: poner todo lo referente a la gui en bajo la clase gui.
Gtk.init


#Widget Definitions
main_window =3D Gtk::Window.new
vbox =3D Gtk::VBox.new( false, 0)
hbox =3D Gtk::HBox.new( true , 0)

scroll =3D Gtk::ScrolledWindow.new
output =3D Gtk::TextView.new
input =3D Gtk::Entry.new

button_connect =3D Gtk::Button.new( "Connect" , use_underline=3Dfalse )
button_disconnect =3D Gtk::Button.new( "Disconnect" , use_underline=3Dfalse=
)

scroll.set_policy( Gtk::pOLICY_NEVER , Gtk::pOLICY_AUTOMATIC )

#need to chomp input every n lines so window doesn't expand on its own.
scroll.add( output )

main_window.add( vbox )
vbox.pack_start( hbox , false , false , 0 )

hbox.pack_start( button_connect , true , true , 0 )
hbox.pack_start( button_disconnect , true , true , 0 )

vbox.pack_start( scroll , true , true, 0 ) #output or scroll
vbox.pack_start( input , false , false, 0 )
output.editable =3D false
output.set_wrap_mode(Gtk::TextTag::WRAP_WORD)

#Signals
main_window.signal_connect("delete_event") { Gtk.main_quit
false
}

input.signal_connect("activate") do output.buffer.insert(=20
output.buffer.end_iter, input.text + "\n")
angalon.mud.puts( input.text )
output.scroll_to_iter( output.buffer.end_iter , 0 , false , 0 , 0 )
input.text=3D""
end

begin
button_connect.signal_connect("clicked") {
angalon =3D Mud.new( "angalon.tamu.edu <http://angalon.tamu.edu>" , 3011 )
angalon.add_mud
}

button_disconnect.signal_connect("clicked") do
angalon.mud.close()
end

main_window.set_default_size( 512, 512 )
main_window.show_all

Gtk.idle_add{
output.scroll_to_iter( output.buffer.end_iter , 0 , false , 0 , 0 )
}

Gdk::Input.add( mud , Gdk::Input::READ ) {=20
data =3D angalon.mud.recv( 32 )
data =3D angalon.mud.preprocess( data )
output.buffer.insert( output.buffer.end_iter , data )
output.scroll_to_iter( output.buffer.end_iter , 0 , false , 0 , 0 )
}

Gtk.main


--=20
Rorschach el Pirata
I eat pokemon with scars

------=_Part_747_3014172.1125498436044--
 
R

Robert Klemme

OxO said:
hi when i try to run this ruby script (a mud client for angalon) y
get the following error

rorschach@pirata ~/Sources/ainamc $ ruby ainamc.rb
ainamc.rb:125: syntax error
Gtk.main
^

Without further looking at this I guess you forgot a closing "end",
bracket or brace. Try throwing this at an editor with autoindention and
see what happens.

Kind regards

robert
 
D

David Roberts

OxO said:
hi when i try to run this ruby script (a mud client for angalon) y get the
following error

rorschach@pirata ~/Sources/ainamc $ ruby ainamc.rb
ainamc.rb:125: syntax error
Gtk.main
^

Might it be that your Ruby installation does not have the
Gtk libraries available?
 
J

Joe Van Dyk

hi when i try to run this ruby script (a mud client for angalon) y get th= e
following error

Your last 'begin' statement has no 'end' statement. That's the start
of the problems, anyways.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top