mIRC Home    About    Download    Register    News    Help

Print Thread
need advice and help if possible socketbot script #204267 13/09/08 08:41 PM
Joined: Aug 2005
Posts: 21
A
anticreeps Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Aug 2005
Posts: 21
Hello i was wondering if someone could help me put few little features and colors to this script i did this myself and im not expert at mirc scripting, what this does is connect to freechess.org server under guest account i would like to be able to see colors on people name var %nick can anyone suggest anything better to this?
also certain words to show up as something else when data is recieved for example change the word lol to LOL but with background color ect thanks



------------------------------------------------------------------

alias fics {
set %fics.window @fics
set %fics.server freechess.org
set %fics.port 5000
if ($sock(fics)) sockclose fics
sockopen fics %fics.server %fics.port
if (!$window(%fics.window)) window -aek0 %fics.window
}
on 1:sockopen:fics:{
if ($sockerr) { aline %fics.window Error connecting to $+(%fics.server,:,%fics.port) }
else {
aline %fics.window Connected.
/sockwrite -n fics guest
/sockwrite -n fics guest
/sockwrite -n fics +chan 50
/sockwrite -n fics set seek 0
}
}
on 1:sockread:fics:{
var %data
sockread %data
%data = $remove(%data,$cr,$lf,fics%)
aline %fics.window %data
if ($regex(%data,/^(.+)(?:\(.+\))?\((\d+)\): (.+)$/U)) {
var %nick = $+($chr(31),$regml(1),$chr(31))
var %room = $regml(2)
var %message = $regml(3)
if (%message == !me) { sockwrite -n $sockname tell %room Hello, %nick $+ ! }
elseif (%message == Hey) { deal }
elseif (%message == `date`) { sockwrite -n $sockname tell %room $date }
elseif (%message == !start) {
if %game == on {
sockwrite -n $sockname tell tell %nick Please type !bet in main to add yourself into the next round
writeini bj.ini money %nick 100
}
else sockwrite -n $sockname tell tell %nick Sorry no game in progress...
}
elseif (%message == !help) {
sockwrite -n $sockname tell %room I don't help you %nick !
}
}
}
on 1:input:%fics.window:if ($mid($1-,1,1) != /) && (!$ctrlenter) sockwrite -n fics $1-


Last edited by anticreeps; 13/09/08 08:57 PM.
Re: need advice and help if possible socketbot scr [Re: anticreeps] #204923 06/10/08 02:55 AM
Joined: Aug 2005
Posts: 21
A
anticreeps Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Aug 2005
Posts: 21
Anyone

Re: need advice and help if possible socketbot scr [Re: anticreeps] #204925 06/10/08 03:07 AM
Joined: Aug 2005
Posts: 1,052
L
Lpfix5 Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Well since you "created" this I will just tell you how to add color around %nick, first you must be aware how to make the colors to start like ex:, CTRL + K will popup the color box then you can add a , with the follow color for background example

CTRL+K8,1 would be yellow text on black background

So in order to add this to the script wherever areas you want custom like %nick example you would so something like this

Hello CTRL+K8 $+ %nick $+ you are now colorful!

lol its just an example

Next to replace test whichever way its incoming you have to use the $replace routine which you can find in /help $replace

something simple would be this little test for you to play with

alias thistest { echo -a $replace($1-,lol,LauGh Out LoUD) }

so if you type /thistest That guy loves to lol all the time

the output would be That guy loves to LauGh Out LoUD all the time


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }