forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Problem With Tommy's IRC Code Sample

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
TimeSurfer
Newbie


Joined: 01 Aug 2002
Posts: 12

PostPosted: Fri Jun 02, 2006 10:56 pm    Post subject: Problem With Tommy's IRC Code Sample Reply with quote

I was trying to test out tommy's irc client sample and for some reason even though i define the net command and function i still get a runtime error

here is tommy's code well at least i think it was tommy's i know he and another person was working on it. Im tryin to reference against it for making my own client but its of no use if i cant get the dll to work correctly in the sample.

option decimalsep,.
external vdsinet.dll,Public Freeware Key|90257236
#define command, net
#define function, net
#define command, win
#define function, win
inifile open,.\@name(%0).ini
%%server = @iniread(general,server)
%%port = @iniread(general,port)
%%channel = @iniread(general,channel)
%%password = @iniread(general,password)
%%clanid = @iniread(general,clanid)
%%topic1 = Clan-IRC Real Time Stats
%%topic2 = Clan-IRC Real Time Chat
%a = -2

DIALOG CREATE, Clan-IRC ,-1,0,564,346
DIALOG ADD,EDIT,eChat,44,6,400,242,,MULTI
DIALOG ADD,EDIT,eText,291,6,400,24
DIALOG ADD,BUTTON,bSubmit,292,411,148,24,&Submit,default
DIALOG ADD,BUTTON,bConnect,180,411,148,35,Connect
DIALOG ADD,BUTTON,bDisconnect,215,411,148,35,Disconnect
DIALOG ADD,BUTTON,bSave,145,411,148,35,Save Settings
DIALOG ADD,BUTTON,bModify,145,411,148,35,Modify Settings
DIALOG ADD,BUTTON,bExit,250,411,148,35,E&xit
DIALOG ADD,STATUS,sStatus
DIALOG ADD,EDIT,eServer,20,6,100,19
DIALOG ADD,EDIT,ePort,20,109,35,19
DIALOG ADD,EDIT,ePassword,20,210,60,19,,,PASSWORD
DIALOG ADD,EDIT,eClanID,20,147,60,19,ClanID
DIALOG ADD,TEXT,lServer,6,6,100,13,Server IP Address
DIALOG ADD,TEXT,lPort,6,109,35,13,Port
DIALOG ADD,TEXT,lPassword,4,210,60,13,Password
DIALOG ADD,TEXT,lClanID,6,147,60,13,Clan ID
Gosub Refresh

:Disable
DIALOG Disable,eServer
DIALOG Disable,ePort
DIALOG Disable,ePassword
DIALOG Disable,eClanID
DIALOG Hide,bSave
DIALOG SHOW
goto SetData

:SetData
%%server = @dlgtext(eServer)
%%port = @dlgtext(ePort)
%%channel1 = #%%clanid-RTS
%%channel2 = #%%clanid-RTC
%%password = @dlgtext(ePassword)
%%name = RT-Bot
%%clanid = @dlgtext(eClanID)
gosub Refresh
goto evloop

:bConnectButton
if @not(@trim(%%server))
Warn Please enter the server's IP address
%a = -1
Goto evloop
end

if @not(@trim(%%port))
Warn Please enter the server port
%a = -1
Goto evloop
end

if @not(@trim(%%password))
Warn Please enter channel password,,PASSWORD
%a = -1
Goto evloop
end

if @not(%%clanid)
Warn Please enter the Clan ID
%a = -1
Goto evloop
end

DIALOG Disable,bConnect
DIALOG Disable,bModify
DIALOG Show
net socket,auto
net socket,vdsevents
net socket,addr,@trim(%%server)
net socket,port,@trim(%%port)
net socket,client
list create,1
list create,2
%a = 0

:evloop
%e = @event()
if %E
goto %E
end
%e = @net(socket,event)
if %E
goto %E
end
wait "0.2"
end
if @EQUAL(%a,-1)
goto evloop
end
%a = @FADD(%a,1)
if @GREATER(%a,25)
gosub bJoinbutton
end
goto evloop

:bSubmitButton
%%data = @dlgtext(eText)
%%char = " "
gosub split
if @equal(@substr(%%command,1,1),/)
%%command = @strdel(%%command,1,1)
%%text = %%command %%params
gosub send
else
%%text = * %%channel2 :%%params
gosub send
end
dialog set,eText
goto evloop

:connect
%%text = USER %%name @chr(34)Clan-IRC@chr(34) @chr(34)@net(socket,addr)@chr(34) :%%name@cr()@chr(10)NICK %%name
gosub send
%a = 0
goto evloop

:bJoinButton
%%text = join %%Channel1
gosub send
%%text = join %%Channel2
gosub send
%%text = mode %%Channel1 +mntk %%password
gosub send
%%text = mode %%Channel2 +mntk %%password
gosub send
%%text = topic %%Channel1 %%topic1
gosub send
%%text = topic %%Channel2 %%topic2
gosub send
%a = -1
end

:network
%%buffer = %%buffer@net(socket,data)
if @not(@zero(@pos(@cr(),%%buffer)))
repeat
%%data = @substr(%%buffer,1,@pred(@pos(@cr(),%%buffer)))
%%buffer = @strdel(%%buffer,1,@succ(@pos(@cr(),%%buffer)))
%%char = " "
gosub split
if @equal(%%command,PING)
%%text = PONG %%params
gosub send
else
list clear,1
list assign,1,@dlgtext(eChat)
list clear,2
list assign,2,%%command %%params
dialog set,eChat,@text(1)@text(2)
end
until @zero(@pos(@cr(),%%buffer))
end
%P = @LEN(@DLGTEXT(eChat))
%P = @sendmsg(@win(~eChat),$0B1,@FSUB(%P,1),%P)
%P = @sendmsg(@win(~eChat),$0B7,0,0)
DIALOG FOCUS,eText
goto evloop

:bExitButton
end

:send
net socket,sendserver,%%text@cr()@chr(10)
list clear,1
list assign,1,@dlgtext(eChat)
list clear,2
list assign,2,%%text
dialog set,eChat,@text(1)@text(2)
exit

:split
if @zero(@pos(%%char,%%data))
%%command = %%data
%%params =
else
%%command = @substr(%%data,1,@pred(@pos(%%char,%%data)))
%%params = @substr(%%data,@succ(@pos(%%char,%%data)),@len(%%data))
end
exit

:closec
list clear,1
list assign,1,@dlgtext(eChat)
list clear,2
list assign,2,Connection closed
dialog set,eChat,@text(1)@text(2)
goto evloop

:error
warn Fatal error: @net(socket,error)

:bModifyButton
DIALOG Enable,eServer
DIALOG Enable,ePort
DIALOG Enable,ePassword
DIALOG Enable,eClanID
DIALOG Disable,bModify
DIALOG Hide,bModify
DIALOG Show,bSave
DIALOG Disable,bConnect
DIALOG SHOW
goto evloop

:bDisconnectButton
%%text = ??????????
gosub send
goto disable

:bSaveButton
DIALOG Hide,bSave
DIALOG Show,bModify
DIALOG Enable,bModify
DIALOG Enable,bConnect
goto Disable
end

:Refresh
DIALOG SET,eServer,%%Server
DIALOG SET,ePort,%%Port
DIALOG SET,ePassword,%%Password
DIALOG SET,eClanID,%%ClanID
DIALOG SHOW
inifile write,general,server,@trim(%%server)
inifile write,general,port,@trim(%%port)
inifile write,general,password,@trim(%%password)
inifile write,general,clanid,%%clanid
exit
end

:close
if @Not(list close,1)
end
if @Not(list close,2)
end
exit

_________________
T-i-m-e-S-u-r-f-e-r
Back to top
View user's profile Send private message Send e-mail
TimeSurfer
Newbie


Joined: 01 Aug 2002
Posts: 12

PostPosted: Fri Jun 02, 2006 10:58 pm    Post subject: Reply with quote

oops i forgot to tell you all im using VDS 5
_________________
T-i-m-e-S-u-r-f-e-r
Back to top
View user's profile Send private message Send e-mail
kOt
Contributor
Contributor


Joined: 19 Jan 2004
Posts: 89
Location: Fyffe, AL

PostPosted: Sat Jun 03, 2006 12:14 pm    Post subject: Reply with quote

i dont know about no @WIN() in VDS5 Very Happy

and i dont think in the vdsinet.dll either

try replacing all the @win() with @winexists()

Code:

%P = @sendmsg(@win(~eChat),$0B1,@FSUB(%P,1),%P)
%P = @sendmsg(@win(~eChat),$0B7,0,0)


With

Code:

%P = @sendmsg(@winexists(~eChat),$0B1,@FSUB(%P,1),%P)
%P = @sendmsg(@winexists(~eChat),$0B7,0,0)

_________________
Visual Dialogscript 5
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
TimeSurfer
Newbie


Joined: 01 Aug 2002
Posts: 12

PostPosted: Sat Jun 03, 2006 6:08 pm    Post subject: Reply with quote

k thanks k0t ill give it a shot
_________________
T-i-m-e-S-u-r-f-e-r
Back to top
View user's profile Send private message Send e-mail
TimeSurfer
Newbie


Joined: 01 Aug 2002
Posts: 12

PostPosted: Sat Jun 03, 2006 7:23 pm    Post subject: Reply with quote

hmm having another problem this piece under evloop is giving me a problem and i dont see why

%e = @net(socket,event)

i get error in external command or function

any ideas????

_________________
T-i-m-e-S-u-r-f-e-r
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
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
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group