Difference between revisions of "Hello World"

From OpenEUO
Jump to: navigation, search
(Created page with "All these samples were taken directly from: http://www.easyuo.com/forum/viewtopic.php?t=43202 and just cruising the forums to give them a little explanation. Let's start by runn...")
 
 
Line 6: Line 6:
 
'''1st sample:'''
 
'''1st sample:'''
  
Print("Hello World!")
+
Print("Hello World!")
  
 
This reminds of programming in BASIC back in the old days.
 
This reminds of programming in BASIC back in the old days.
Line 14: Line 14:
 
'''2nd sample:'''
 
'''2nd sample:'''
  
UO.CliNr = 1
+
UO.CliNr = 1
 +
UO.Macro(8,2,'')
 +
wait(1000)   
 +
UO.Msg("Hi, my name is " .. UO.CharName .. "!\n")
 +
print("UO.CharName = " .. UO.CharName)
  
UO.Macro(8,2,'')
 
  
wait(1000)   
 
  
UO.Msg("Hi, my name is " .. UO.CharName .. "!\n")
+
[[UO.CliNr]] = 1 - selects which client will be running this short sample
  
print("UO.CharName = " .. UO.CharName)
+
[[UO.Macro]](8,2,'') - initiates a client-side macro (see [[UO.Macro]] for options)
 
+
 
+
 
+
UO.CliNr = 1 - selects which client will be running this short sample
+
 
+
UO.Macro(8,2,'')
+
  
 
wait(1000)  - 1 second delay
 
wait(1000)  - 1 second delay
  
UO.Msg("Hi, my name is " .. UO.CharName .. "!\n") - the character running in the first client will saying this statement.
+
[[UO.Msg]]("Hi, my name is " .. [[UO.CharName]] .. "!\n") - the character running in the first client will saying this statement.
  
print("UO.CharName = " .. UO.CharName) - display this output in the application message thread
+
print("UO.CharName = " .. [[UO.CharName]]) - display this output in the application message thread
  
  
 
'''3rd sample:'''
 
'''3rd sample:'''
  
Form1 = Obj.Create("TForm")
+
Form1 = [[Obj.Create]]("TForm")
  
 
Form1.Caption = "Hey, it works!"
 
Form1.Caption = "Hey, it works!"
  
Form1.OnClose = function() Obj.Exit() end
+
Form1.OnClose = function() [[Obj.Exit]]() end
  
 
Form1.Show()
 
Form1.Show()
  
Obj.Loop()
+
[[Obj.Loop]]()
  
 
This will create a window that closes when the running script is stopped.  The window is sizable and can be relocated in an viewable potion of the screen, just like a window in the Graphic User Interface (GUI).
 
This will create a window that closes when the running script is stopped.  The window is sizable and can be relocated in an viewable potion of the screen, just like a window in the Graphic User Interface (GUI).

Latest revision as of 14:45, 9 October 2010

All these samples were taken directly from: http://www.easyuo.com/forum/viewtopic.php?t=43202 and just cruising the forums to give them a little explanation.

Let's start by running a version of OpenEUO. The version used was 0.9s and the samples should be compatible with subsequent release(s).


1st sample:

Print("Hello World!")

This reminds of programming in BASIC back in the old days. But it would like: 10 Print "Hello World!"


2nd sample:

UO.CliNr = 1
UO.Macro(8,2,)
wait(1000)    
UO.Msg("Hi, my name is " .. UO.CharName .. "!\n")
print("UO.CharName = " .. UO.CharName)


UO.CliNr = 1 - selects which client will be running this short sample

UO.Macro(8,2,) - initiates a client-side macro (see UO.Macro for options)

wait(1000) - 1 second delay

UO.Msg("Hi, my name is " .. UO.CharName .. "!\n") - the character running in the first client will saying this statement.

print("UO.CharName = " .. UO.CharName) - display this output in the application message thread


3rd sample:

Form1 = Obj.Create("TForm")

Form1.Caption = "Hey, it works!"

Form1.OnClose = function() Obj.Exit() end

Form1.Show()

Obj.Loop()

This will create a window that closes when the running script is stopped. The window is sizable and can be relocated in an viewable potion of the screen, just like a window in the Graphic User Interface (GUI).