Author Topic: Question about Scripting  (Read 2056 times)

0 Members and 1 Guest are viewing this topic.

Offline jtw1984Topic starter

  • Sr. Member
  • *
  • Posts: 295
  • Activity:
    0%
  • Reputation Power: 5
  • jtw1984 has no influence.
  • Gender: Male
  • Danger is my Middle Name
  • Respect: +11
  • Referrals: 1
    • View Profile
Question about Scripting
« on: April 18, 2010, 12:45:44 PM »
0
Alright, I'm finally going to make the plunge to start learning how to write scripts. I have a question about the coding though. Is the coding you learn from scripting a variation of any other coding? Or is it only good for Ultima Online?


Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13305
  • Activity:
    0.6%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Question about Scripting
« Reply #1 on: April 18, 2010, 12:49:14 PM »
0
You better start with "Open"EUO or else Cheffe's head will explode!  hehe.  (kidding, I don't use OpenEUO; I care to not learn yet another language...)

Seriously, though.  EUO is sort of it's own syntax.  It's meant to be very simple and easy to start with.  There are similar constructs in EUO as you might find in classical interpreted and compiled languages.  So you might notice some similarity, but find no real help with any one.  So it's generally best to take your favorite script you use daily and take it apart to see how it works.
« Last Edit: April 18, 2010, 12:59:00 PM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline jtw1984Topic starter

  • Sr. Member
  • *
  • Posts: 295
  • Activity:
    0%
  • Reputation Power: 5
  • jtw1984 has no influence.
  • Gender: Male
  • Danger is my Middle Name
  • Respect: +11
  • Referrals: 1
    • View Profile
Re: Question about Scripting
« Reply #2 on: April 18, 2010, 02:04:19 PM »
0
Ah k thanks!

Offline Superslayer

  • Elite
  • *
  • *
  • Posts: 1006
  • Activity:
    0%
  • Reputation Power: 14
  • Superslayer barely matters.Superslayer barely matters.
  • Gender: Male
  • Well what do you drink? Not tea.
  • Respect: +43
  • Referrals: 0
    • View Profile
Re: Question about Scripting
« Reply #3 on: April 18, 2010, 03:38:11 PM »
0
A nice way of learning is to use pseudo-code (real words to describe the objective).  I picked this up from Freddy at WinUo. Here's an example of a simple procedure to find an item in a container, and move it to another one.  It's not exact, but the idea's there:
Code: [Select]
; pseudo-code
look for container A
set the id
look for container B
set the id
find item A in container A
set the id
lift item A from container A
drop item A into container B

Now one-by-one, replace each pseudo-line command with the appropriate euo language command
Code: [Select]
finditem ABC G_5                                    ; find container A within 5 tiles of your character
set %ContainerA #findid                             ; sets the specific id of the container to a variable
ignoreitem %ContainerA                              ; ignores ContainerA so you can find ContainerB
finditem ABC G_5                                    ; find container B within 5 tiles of your character
set %ContainerB #findid                             ; sets the specific id of the container to a variable
ignoreitem reset                                    ; since we ignored ContainerA , we'll have to un-ignore it
finditem XYZ C_ , %ContainerA                       ; now we look for the item in ContainerA
set %Item #findid                                   ; sets the specific id of the item to a variable
exevent drag %Item                                  ; lift the item out of the container
exevent dropc %ContainerB                           ; drop the item into ContainerB

Again, this example won't exactly work because the 'finditem' types are not correct, no wait's and prob some other stuff.  But just take it easy, line by line and definitely ask questions !  :)

Offline jtw1984Topic starter

  • Sr. Member
  • *
  • Posts: 295
  • Activity:
    0%
  • Reputation Power: 5
  • jtw1984 has no influence.
  • Gender: Male
  • Danger is my Middle Name
  • Respect: +11
  • Referrals: 1
    • View Profile
Re: Question about Scripting
« Reply #4 on: April 18, 2010, 07:50:59 PM »
0
I will def be asking questions. :D As few as possible though. I'll try to start with something small. Give me a few weeks or couple months though. Ya know...work and all. Thanks again.

Tags: