TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

system commands and variables

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
techman246



Joined: 27 May 2013
Posts: 46

PostPosted: Sun Aug 31, 2014 10:23 pm    Post subject: system commands and variables Reply with quote

so i would like to put the output of the date command into a variable so that i can make logfiles with the date added. how can i execute the date command in the shell and put the output into a tintin variable for accessing?

Thanks
Back to top
View user's profile Send private message
PowerGod



Joined: 04 Aug 2014
Posts: 339

PostPosted: Mon Sep 01, 2014 5:06 am    Post subject: Reply with quote

With #script you can do this

Code:

#script MyVariable {date}


else you can also use the internal function #format, where you can even modify easily how the date must be shown

Code:

#format MyVariable {%t} {%Y-%m-%d %T}
Back to top
View user's profile Send private message
techman246



Joined: 27 May 2013
Posts: 46

PostPosted: Fri Sep 12, 2014 4:10 pm    Post subject: that worked. One more question Reply with quote

so that format command worked perfectly for making my logs.

I now have another question

how would i go about making a menu with six options

example: the menu is to play streams from online radio stations

you type "radio"
a menu pops up like this

"Which radio station would you like to listen to?"
1) Radio 1
2) Radio 2
3) Radio 3
4) Radio 4

I already know how to make the alias for "radio" and i know how to use showme to make it ask "Which radio station would you like to listen to?" I also know the commands to start the streams

What I don't know is how i could make the menu options. I might be able to do it in bash and make the menu alias execute a bash script that plays the radio station. What do you think?

Thanks
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Fri Sep 12, 2014 8:22 pm    Post subject: Reply with quote

Could use:

Code:

#alias {radio}
{
  #if {"%0" == ""}
  {
    #showme Which radio station would you like to listen to?
  };
  #elseif {%0 == 1}
  {
     #run radio <command>
  };
  #elseif {%0 == 2}
  {
     etc
  }
}


Then you'd type "radio" for an overview, and "radio 1" to pick option 1.

Can add "#kill radio" to remove the radio session if you want to switch stations.
Back to top
View user's profile Send private message Send e-mail
techman246



Joined: 27 May 2013
Posts: 46

PostPosted: Tue Sep 23, 2014 9:16 pm    Post subject: Reply with quote

okay i now have menus working. 1 more question

How can i gag only the next incoming line?

so if a alias such as "ambon" needs your current location it would send "room" to the mud. this would return a line such as "Central Station: corridor". how could i gag this line from the user?
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Wed Sep 24, 2014 6:36 am    Post subject: Reply with quote

You can execute '#line gag' to gag the next line.
Back to top
View user's profile Send private message Send e-mail
techman246



Joined: 27 May 2013
Posts: 46

PostPosted: Fri Sep 26, 2014 5:04 pm    Post subject: macro issues Reply with quote

okay. i need to make macros out of the numbers 1-9 but if i say any numbers it triggers the macro. is their a way i can make it not trigger if it is something like say 6?
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Fri Sep 26, 2014 5:45 pm    Post subject: Reply with quote

Nope.

Maybe try using F1 to F9, or alt-1, alt-2, or ctrl-1, ctrl-2, etc.

Use #config convert on to see control codes.
Back to top
View user's profile Send private message Send e-mail
techman246



Joined: 27 May 2013
Posts: 46

PostPosted: Fri Sep 26, 2014 6:14 pm    Post subject: hmmm Reply with quote

okay well i was wanting to use the number pad and i tried alt+ the number and ctrl+ the number but didn't get any escape codes that i could use. I'm trying to avoid the number row for this particular set of actions. are their any distinguishing charicteristics between the numpad keys and the number keys. maybe like key number or something else i can use
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Fri Sep 26, 2014 7:44 pm    Post subject: Reply with quote

You might have to toggle num lock, or check your terminal emulator's documentation on how to switch to keypad mode.

Other option is using a different terminal emulator that supports keypad mode.
Back to top
View user's profile Send private message Send e-mail
techman246



Joined: 27 May 2013
Posts: 46

PostPosted: Fri Sep 26, 2014 10:20 pm    Post subject: current setup Reply with quote

i'm using gnome-terminal because its the only emulator that i know for certin works with the orca screen reader. whether it supports keypad mode or not i don't know
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Sat Sep 27, 2014 9:00 pm    Post subject: Reply with quote

Gnome-terminal doesn't support keypad mode as far as I know. Guess you could shop around.
Back to top
View user's profile Send private message Send e-mail
techman246



Joined: 27 May 2013
Posts: 46

PostPosted: Thu Oct 02, 2014 12:56 am    Post subject: Reply with quote

well, the only problem is i think orca only supports gnome-terminal. and one more question. how could i log a users input? so for example i want to create a file with user-specific variables in it such as ./.username.tin where username is the characters name. where the mud asks for username i would like to record the username typed and then create the file for that user.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Thu Oct 02, 2014 7:52 am    Post subject: Reply with quote

You can type: #history write <filename> to save the command history to file.

Can use a SESSION DISCONNECTED event to save the command history, and SESSION CONNECTED to load it. See #help event.
Back to top
View user's profile Send private message Send e-mail
techman246



Joined: 27 May 2013
Posts: 46

PostPosted: Thu Oct 02, 2014 9:05 pm    Post subject: Reply with quote

so what i would like to do is something like #action {Username:} {some code to record the users input into a variable}
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Fri Oct 03, 2014 7:19 am    Post subject: Reply with quote

Can temporary set the RECEIVED INPUT event to capture the next input.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> General Discussion All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group