Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
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
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.
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
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
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?
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.
  
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
Page 1 of 1
» All times are GMT - 5 Hours
 
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

 

Advertisement