/* Ping script for use with AmIRC 1.x */ Version = '1.04' /*
// Written by Deryk Robosson 3.1.96
//
// newlook@ameritech.net newlook on #amiga IRC (EfNet)
//
// 02.02.97 (1.01) - Added flood support to script
//                   as well as just passing it a user nick.
// 04.03.97 (1.02) - Prettied up the display of information
// 07.03.97        - Corrected typeo in the .readme file
// 09.03.97 (1.03) - Corrected HELP info for flood template
// 18.03.97 (1.04) - cleaned up the code
*/
/* set your ping count here */
count = 5

bold = d2c(2)
underline = '1F'x

options results
parse arg param

param = trim(upper(param))
if param = ''|param='VER' then signal version
if param = 'HELP' then signal help

if param ~= '' then do
    parse var param site' 'command
    if site ~= '' then site = strip(upper(site))
    else site=''
    if command ~= '' then command=strip(upper(command))
    else command = ''
end

'USERHOST 'site
if result ~= 'RESULT' then parse var result user'@'site

/* prepare for the main file */
con = 'con:0/0/600/100/PingOutput/CLOSE/SIMPLEREFRESH'

/* switch on our parameters */
if command = '' then ping = 'amitcp:bin/ping -c' count||' '||site '>' con
else if command = 'FLOOD' then ping = 'amitcp:bin/ping -f' site ' >' con

ADDRESS COMMAND ping
EXIT

version:    /* show the user version information */
    call echo(bold'Ping.AMIRX'bold' Version 'bold||version)
    call echo('Read the top of Ping.AMIRX script for history.')
    call echo(bold'©1996,1997'bold' Deryk Robosson 'bold'(newlook)'bold' - [newlook@ameritech.net]')
    call echo('Type /<alias> help for command information')
exit

help:   /* show the user help examples */
    call echo(bold'Ping.AMIRX'bold' Help')
    call echo(bold'VER - 'bold'displays script version')
    call echo(bold'FLOOD - 'bold'selects ping flood')
    call echo(bold'HELP - 'bold'displays this file')
    call echo(bold||underline'EXAMPLES:'bold||underline)
    call echo(bold'/Pi site.com 'bold' will ping a site')
    call echo(bold'/Pi usernick 'bold' will ping the users site')
    call echo(bold'/Pi site.com FLOOD 'bold' will flood the site')
exit

echo: procedure
	parse arg a
	'echo P='d2c(27)'b«Ping» 'a
return 1
