CEMETECH
Leading The Way To The Future
Login [Register]
Username:
Password:
Autologin:

Don't have an account? Register now to chat, post, use our tools, and much more.
Latest Headlines
Online Users
There are 104 users online: 3 members, 75 guests and 26 bots.
Members: ProgrammerNerd.
Bots: VoilaBot (1), Spinn3r (1), MSN/Bing (1), Magpie Crawler (3), VoilaBot (1), Googlebot (16), MSN/Bing (3).
RSS & Social Media
SAX
You must log in to view the SAX chat widget
Author Message
technomonkey76


Advanced Member


Joined: 09 Dec 2009
Posts: 291
Location: Inside your computer

Posted: 01 Apr 2011 01:32:07 pm    Post subject: gCn Client Shell Script (for Linux)

I made a script to ease the process of connecting to gCn, and it includes a nifty ASCII logo. The script also suppresses messages not dealing with errors (using grep). Feel free to use it as you would like.


Code:
#!/bin/sh
clear
echo 'vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv'
echo '|          _________         |'
echo '|    _____ \_   ___ \  ___   |'
echo '|   / ___ \/    \  \/ /   \  |'
echo '|  / /_/  /\     \___|  |  \ |'
echo '|  \___  /  \_____  /___|  / |'
echo '| /_____/         \/     \/  |'
echo '|                            |'
echo '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'
echo '------globalCALCnet v2.2------'
echo '-------By: Kerm Martian-------'
echo '-------dcs.cemetech.net-------'
echo
echo
echo
echo "Choose option"
echo "[1] Connect"
echo "[2] Quit"
echo
read -p "> " CONNECT
if [ $CONNECT = "1" ]
then
echo
echo "Input desired method of connection"
echo "[1] Direct USB"
echo "[2] Arduino-based Bridge"
echo "[3] USBHID/'10-Dollar' Bridge"
echo
read -p "> " METHOD
echo
echo "Input desired name for LOCAL gCn hub"
echo
read -p "> " NAME
echo
echo "Choose online hub"
echo "[1] IRCHub"
echo "[2] oblithub"
echo "[3] Other (Specify Custom)..."
echo
read -p "> " HUB
echo
if [ $HUB = "1" ]
then
export HUBNAME="IRCHub"
fi
if [ $HUB = "2" ]
then
export HUBNAME="oblithub"
fi
if [ $HUB = "3" ]
then
echo "Input the name of the SERVER hub to connect to"
echo
read -p "> " HUBNAME
fi
clear
echo "Ctrl+C to quit..."
echo '(Do NOT use Ctrl+Z!!!)'
echo
echo "In case of emergency, unplug the cable from the calculator,"
echo "and press [ON], [ON], [CLEAR] on the calculator to exit the"
echo "currently running Cn2.2 program."
echo
echo "When using oblithub, a key *MUST* be held down at at times"
echo "until prgmOBLITR8 has been launched on the calculator!"
echo "If no key is held down, the calc will essentially freeze."
echo
echo "Press [ENTER] to run the gCn Client application."
read CONTINUE
clear
if [ $METHOD = "1" ]
then
sudo gcnclient -l $NAME -n $HUBNAME -d d | grep "device"
fi
if [ $METHOD = "2" ]
then
sudo gcnclient -l $NAME -n $HUBNAME -d a | grep "device"
fi
if [ $METHOD = "3" ]
then
sudo gcnclient -l $NAME -n $HUBNAME -d u | grep "device"
fi
fi

_________________



Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55764
Location: Earth, Sol, Milky Way

Posted: 01 Apr 2011 01:40:39 pm    Post subject:

This looks great, thanks for sharing! I'll try to remember to make a similar version for Windows and cmd, unless you want to do it for me. Smile Also, with the new gCnClient and DCS version I'm working on, hopefully that "hold key until you launch program" thing will no longer be necessary.
_________________


Back to top
technomonkey76


Advanced Member


Joined: 09 Dec 2009
Posts: 291
Location: Inside your computer

Posted: 01 Apr 2011 01:44:19 pm    Post subject:

KermMartian wrote:
This looks great, thanks for sharing! I'll try to remember to make a similar version for Windows and cmd, unless you want to do it for me. Smile Also, with the new gCnClient and DCS version I'm working on, hopefully that "hold key until you launch program" thing will no longer be necessary.


Awesome! I would create a batch file for you, but I have absolutely no experience programming batch files. Sad
_________________



Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55764
Location: Earth, Sol, Milky Way

Posted: 02 Apr 2011 05:48:02 am    Post subject:

Not a problem; I can do the batch file myself. However, it's more likely that I'll just wait for Shaun to write a GUI frontend for the Windows side of it, if he still has an interest in doing so. Smile
_________________


Back to top
Compynerd255


Power User


Joined: 08 Apr 2011
Posts: 397

Posted: 11 Apr 2011 05:16:27 pm    Post subject:

I have a question about implementing gCn, since my Arduino is currently shipping. Apparently, there is a required argument "-s" to specify what server daemon to connect to, which is currently a single server. But I cannot find the IP address for that server anywhere. And yet that parameter is not included in this batch file. So, is the "-s" parameter required?
_________________
Visit Betafreak Games: http://www.betafreak.com
Help Me Pay for College:
- Sign up for Fastweb through my referal link!
Back to top
technomonkey76


Advanced Member


Joined: 09 Dec 2009
Posts: 291
Location: Inside your computer

Posted: 11 Apr 2011 05:18:44 pm    Post subject:

Compynerd255 wrote:
I have a question about implementing gCn, since my Arduino is currently shipping. Apparently, there is a required argument "-s" to specify what server daemon to connect to, which is currently a single server. But I cannot find the IP address for that server anywhere. And yet that parameter is not included in this batch file. So, is the "-s" parameter required?

No, the program will fill in the -s argument automatically.
_________________



Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are GMT - 5 Hours

 
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

© Copyright 2000-2013 Cemetech & Kerm Martian :: Page Execution Time: 0.027353 seconds.