Hey guys, i just got challenged to prove that one can make an Irc Bot Using Dark Basic Pro! Im not that good at networking but i know you can build an IRC client in DBPRO using Winsock... This is the code i am using right now:
set window on
set window title "Bot"
#constant SERVER_HOST "irc.netstable.net"
#constant SERVER_PORT 6667
channel as DWORD
nick$ = "TestBot"
user$ = "TestBot"
name$ = "TestBot"
winsock make
if (winsock error())
print winsock error msg$()
wait key
end
endif
channel = winsock connect(SERVER_HOST, SERVER_PORT)
check_for_error(channel)
winsock send string channel,"NICK"+nick$
winsock send string channel,"USER"+user$
winsock send string channel,"Join #skullbox"
do
loop
function check_for_error(a_channel as DWORD)
if (winsock channel error(a_channel))
cls
print winsock channel error msg$(a_channel)
wait key
winsock clean up
end
endif
endfunction
i tired to connect to the server and send the messages for Nick, User and the channel i want to join.. But it doesn't join the channel... Any Idea why?