-
Notifications
You must be signed in to change notification settings - Fork 2
/
IrcMain.mm
51 lines (36 loc) · 1.27 KB
/
IrcMain.mm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#import <Foundation/Foundation.h>
#import "ConnectionController.h"
@interface testClass : NSObject {}
@end
@implementation testClass
-(void)clientHasReceivedBytes:(NSMutableArray*)messageArray{
//Delegate method of ConnectionController class.
}
@end
int main(int argc, const char * argv[])
{
@autoreleasepool{
testClass *c = [[testClass alloc] init];
ConnectionController* client = [[ConnectionController alloc] init];
[client setHost:@"light.wa.us.SwiftIRC.net"]; //first server of google list
[client setPort:6667];
[client setNick:@"Test"];
[client setName:@"Test"];
[client setPass:@"Test"];
[client setMode:0];
[client setPrintIncomingStream:YES];
[client setDelegate:c];
[client connect];
[client join:@"#example"];
[client msg:@"Test message" toChannel:@"#example"];
[client send:[NSString stringWithFormat:@":%@ PRIVMSG %@ :Test Message",client.nick,@"#example"]]; //Same command as the previous line, just using general send: method
[client leaveChannel:@"#example"];
while(1){
sleep(5); //Just to keep alive.
}
}
return 0;
}
/*THIS IS AN UNSTABLE VERSION, USE IT CAREFULLY
//WRITTEN BY @H3xept & @Jndok
*/