Commands Section - ThomasTheSpaceFox/tfun GitHub Wiki
###READ THIS FIRST!!!!!!!
info on first 4 lines of script:
1: shabang line, ignored by tfun. the shabang should be #!/bin/tfun
2: plain text name of the tfun program.
3: author of the tfun program
4: exact media directory name (if sampletfun.sh
is in /sample/path
and the media directory is sample
then the path to the media directory would be: /sample/path/sample
)
actual commands start on line 5
AT END OF SCRIPT PLACE COMMAND: END
ON LAST LINE!!!!
TEXT
start command: TEXT
end command: END-TEXT
usage: prints lines between it's start and end command
example:
TEXT
your text here!
END-TEXT
output would be: your text here!
TXT-ART
start command: TXT-ART
end command: END-TXT-ART
usage: prints lines between it's start and end command
output same as "TEXT" command but TXT-ART is intended to prevent a possible speech support from "reading" text art
PIXMAP
start command: PIXMAP
end command: END-PIXMAP
usage: display images
PIXMAP
sample.png
END-PIXMAP
the image file must be in the media directory
CLEAR
single line: CLEAR
clears screen
BELL
single line: BELL
creates audible bell via system speaker and echo's bell function
MEDIAPLAY
start command: MEDIAPLAY
end command: END-MEDIAPLAY
usage: play media
MEDIAPLAY
sample.mp3
END-MEDIAPLAY
the media file must be in the media directory
URL-CALL
start command: URL-CALL
end command: END-URL-CALL
usage: open url in web browser
URL-CALL
https://duckduckgo.com
END-URL-CALL
this would open duck duck go's website
BASHCALL
start command: BASHCALL
end command: END-BASHCALL
usage: call bash script or possibly other tfun script from media directory
BASHCALL
sample.sh
END-BASHCALL
the script must be in the media directory
WAIT-NULL
start command: WAIT-NULL
end command: END-WAIT-NULL
usage: display message, wait for user to press enter,
WAIT-NULL
press enter to continue
waitnull1
END-WAIT-NULL
note the variable. i recommend waitnull
and a number to avoid messing anything up.
QUIZ-Q
start command: QUIZ-Q
end command: END-QUIZ-Q
usage: quiz the user
QUIZ-Q
what time does a clock go to the doctor?
A: 4.00
B: 5.00
,
C: 6.00
-A
C
END-QUIZ-Q
this will require a little more explaining...
everything before -A
the user sees. while the line between -A and END-QUIZ-Q is
the correct awnser. a wrong awnser will add to question count but not correct awnser count.
while a correct awnser will add to both the correct awnser count and question count.
QUIZ-SCORE
start command: QUIZ-SCORE
end command: END-QUIZ-SCORE
usage: shows user user's score. (for quiz system)
optional sub command -C
: clears score
optional sub command -P
: prints score to score.txt
in media directory (use before -C
!!!!!)
any line until END-QUIZ-SCORE
that is not a sub-command is shown to user.
QUIZ-SCORE
random message to user here
-P
-C
END-QUIZ-SCORE
Note: put message to user, then -P, then -C.
SKIP
comment out a section
SKIP
skipped section
END-SKIP
TIMGCALL
2 line command. second line specifies T-IMG terminal image in media directory
see T IMG terminal image for more help on the T-IMG format.
TIMGCALL
sampletimgfile.TIMG
END
single line: END
as mentioned at the top of this page this is mandatory.
usage: always put at end of script. it tells tfun that script is over (this does NOT happen automatically)