Which code is correct?

The place to discuss scripting and game modifications for X²: The Threat.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

User avatar
Kailric
Posts: 985
Joined: Sun, 7. Dec 03, 05:15
x3

Which code is correct?

Post by Kailric »

Which code is correct in order to make toast?
A.code 1
B.code 2
C.code 3
D.all of the below


code 1

Code: Select all

$Toaster==$PluggedIn
$Bread==[TRUE]
If $Toast==$Toaster AND $Bread
write to log= 'You have toast'
end
code 2

Code: Select all

$Toaster==$PluggedIn
$Bread==[TRUE]
If $Toast==$Toaster AND $Bread==[TRUE]
write to log= 'You have toast'
end
code 3

Code: Select all

$Toaster==$PluggedIn
$Bread==[TRUE]
If $Toast==$Toaster AND ($Bread==[TRUE])
write to log= 'You have toast'
end
"Try not. Do or do not, there is no try."-Yoda

"[Its] time for the human race to enter the solar system"-Dan Quayle
XeHonk
Posts: 1087
Joined: Sun, 7. Mar 04, 23:03
x3tc

Post by XeHonk »

none :)
$Toast==$Toaster <-- unless you tend to have your toast plugged in
User avatar
moggy2
Posts: 5505
Joined: Wed, 6. Nov 02, 20:31
x3ap

Post by moggy2 »

XeHonk wrote:none :)
$Toast==$Toaster <-- unless you tend to have your toast plugged in
:o :gruebel:

wibble!

They'd all be correct, if you'd plugged your toast in. :?
User avatar
JustHere4Coffee
Posts: 1075
Joined: Wed, 6. Nov 02, 20:31
x2

Post by JustHere4Coffee »

well, for a start you have too many = signs - "==" means "is equal to" and is a check, not a setting...

Code: Select all

$Toaster=[PLAYERGRILL]
$PluggedIn= get amount of ware Energy Cells in $Toaster
$Toast= get amount of ware Bread in $Toaster
if $Toast > 0 AND $PluggedIn > 100
   wait randomly from 2 to 5 minutes
   write to playerlog "your toast is done"
@  = remove 100 units of ware Energy Cells from $Toaster
   $Toaster -> eject $Toast units of ware Bread
end
but I'm no expert ;)[/code]
stella
Posts: 1004
Joined: Tue, 17. Feb 04, 18:41
x2

Post by stella »

I use

Code: Select all

    = [THIS] -> call script 'yellatmissus' :  whine = 'darling, any chance of some toast? Luv you! Thanks'
Seems to work, as long as you keep them topped up with flowers
User avatar
JustHere4Coffee
Posts: 1075
Joined: Wed, 6. Nov 02, 20:31
x2

Post by JustHere4Coffee »

hehehehe

Return to “X²: The Threat - Scripts and Modding”