Menu

[r1]: / WinBotPrj.dpr  Maximize  Restore  History

Download this file

301 lines (282 with data), 12.5 kB

  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
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
{ __ ____ __ ______ __
| | / | / / __ / ____ \ / /
| | / /| | / / /_/ / / \ \ / /
| | / / | | / / __ _____ / /_____/ /____ / /
| | / / | | / / / / / ___ \ / __ ____// __ \ / /___
| | / / | | / / / / / / \ \ / / \ \ / / / // _____)
| | / / | | / / / / / / / // / \ \ / / / // /
| |/ / | |/ / / / / / / // /_____/ // /_/ // /____
|___/ |___/ /_/ /_/ /_//_________/ \____/ \______)
An IRC Bot For Win32 (Windows 9x/NT/2000/ME/XP) By C.J.Edwards
==============================================================
Source Code In Delphi 3.0 - Not MSVC++ for once :)
This source code is © Craig James Edwards (BRAiN/Digitalis, also BRAiN/Crypt), 1999-2002
The executable and its documentation (in any possible format) may be distributed freely
so long as only reasonable charges are made for media, etc. This source code may not be
distributed to any third parties without written permission of C.J.Edwards.
No warranty included with this program in any way, don't expect help with things you dont
have to pay for :-)
If you would like to place WinBot on any kind of demo CD, or other commercial distribution,
then please email the address below.
brain@winbot.co.uk
}
program WinBotPrj;
uses
Forms,
windows,
SysUtils,
WinBotMain in 'WinBotMain.pas' {WinBot},
ConnectGraphic in 'ConnectGraphic.pas' {Connecting},
EventMessage in 'EventMessage.pas' {Msg},
FingerUnit in 'FingerUnit.pas' {FingerWindow},
ProtectionUnit in 'ProtectionUnit.pas' {Protection},
AutoOpTree in 'AutoOpTree.pas' {AutoOp},
PluginList in 'PluginList.pas' {PluginLst},
SeperateTerminal in 'SeperateTerminal.pas' {IRCTerm},
WebExtensionsLogin in 'WebExtensionsLogin.pas' {WebExt},
UserListInfoUnit in 'UserListInfoUnit.pas' {UserListInfo},
OperPasswordBox in 'OperPasswordBox.pas' {OperPassword},
AdminEditor in 'AdminEditor.pas' {AdminEdit},
PartyLineChannelList in 'PartyLineChannelList.pas' {PL_Channels},
MOTDedit in 'MOTDedit.pas' {plineMOTD},
ChannelUserlist in 'ChannelUserlist.pas' {NamesListPopup},
ContextHelpWindow in 'ContextHelpWindow.pas' {CtxHelp},
PluginLoading in 'PluginLoading.pas' {PlgLoading},
UnloadPlugin in 'UnloadPlugin.pas' {UnloadPlg},
CreateUser in 'CreateUser.pas' {UserEdit},
ChannelList_Window in 'ChannelList_Window.pas' {CList},
PluginAutoLoad in 'PluginAutoLoad.pas' {AutoLoadList},
KeyWindow in 'KeyWindow.pas' {KeyPrompt},
ChannelSelector in 'ChannelSelector.pas' {SelectChannel},
BotUtils in 'BotUtils.pas',
ServerAddDialog in 'ServerAddDialog.pas' {ServerAdd},
WinBotLib in 'Units\WinBotLib.pas',
AddEventUnit in 'AddEventUnit.pas' {AddEvent},
ScriptDebug in 'ScriptDebug.pas' {DebugWindow},
PluginThread in 'PluginThread.pas',
Plugins in 'Plugins.pas',
IconThread in 'IconThread.pas',
WBS in 'WBS.pas',
OutputThread in 'OutputThread.pas',
SplashScreen in 'SplashScreen.pas' {Splash},
StorageProvider in 'StorageProvider.pas';
// Include our own resources, ignoring the crappy ones that delphi creates
// (we want two icons in the resource file, and a set of bitmaps)
{$R WinBotVS.RES}
Const NFORMS = 29;
Var U,V:Integer;
begin
WinBotLib.DEBUG:=False;
If ParamCount>0 then
Begin
// WinBot.exe -uninstall
If ParamStr(1)='-uninstall' then // This parameter starts the uninstaller and exits
Begin
WinExec('uninstall.exe',SW_SHOW);
Halt;
end;
// WinBot.exe -wait <secs>
If ParamStr(1)='-wait' then
Begin
try
SleepEx(StrToInt(ParamStr(2))*1000,False); // This parameter causes delayed startup
except
MessageBox(0,'Invalid value for -wait parameter. Correct syntax is'#13#10#13#10'WinBot.exe -wait <seconds>'#13#10#13#10'This program will now terminate.','Parameter Error',MB_OK+MB_ICONEXCLAMATION);
Halt;
end;
End;
// WinBot.exe -debug
If ParamStr(1)='-debug' then WinBotLib.DEBUG:=True; // This parameter causes delayed startup
End;
BotUtils_InitMusic;
Application.Initialize;
Application.Title:='WinBot 32-Bit';
Application.HelpFile:='Winbot.chm';
If not SP_InitProvider(ExtractFilePath(Application.ExeName)+'\StorageProviders\FlatFile.dll') then
Begin
MessageBox(0,'Could not load the storage provider DLL, quitting now.','Fatal error',MB_OK+MB_ICONSTOP);
Halt;
End;
with TSplash.Create(nil) do
try
try
ProgressBar1.MaxValue := NFORMS;
If ParamCount>0 then If ParamStr(1)='-nosplash' then
Begin
Left:=9000;
Top:=9000;
End;
Show;
Update;
State.Caption:='Initialising main window...';
Application.CreateForm(TWinBot, WinBot);
WinBot.Hide;
Application.Icon.Handle:=WinBot.Icon.Handle;
try
U:=SToL(ReadINI('screenpos','WindowX'));
V:=SToL(ReadINI('screenpos','WindowY'));
If (U<>0) and (V<>0) then
Begin
WinBot.Top:=V;
WinBot.Left:=U;
End;
except
end;
ProgressBar1.Progress:=ProgressBar1.Progress+1;
State.Caption:='Creating bitmaps...';
Update;
ProgressBar1.Progress:=ProgressBar1.Progress+1;
State.Caption:='Initialising protection window...';
Update;
Application.CreateForm(TProtection, Protection);
ProgressBar1.Progress:=ProgressBar1.Progress+1;
State.Caption:='Initialising IRC terminal...';
Update;
Application.CreateForm(TIRCTerm, IRCTerm);
ProgressBar1.Progress:=ProgressBar1.Progress+1;
State.Caption:='Initialising connect...';
Update;
Application.CreateForm(TConnecting, Connecting);
ProgressBar1.Progress:=ProgressBar1.Progress+1;
State.Caption:='Initialising messages...';
Update;
Application.CreateForm(TMsg, Msg);
ProgressBar1.Progress:=ProgressBar1.Progress+1;
State.Caption:='Initialising finger client...';
Update;
Application.CreateForm(TFingerWindow, FingerWindow);
ProgressBar1.Progress:=ProgressBar1.Progress+1;
State.Caption:='Initialising auto lists...';
Update;
Application.CreateForm(TAutoOp, AutoOp);
ProgressBar1.Progress:=ProgressBar1.Progress+1;
State.Caption:='Initialising plugin interface...';
Update;
Application.CreateForm(TPluginLst, PluginLst);
ProgressBar1.Progress:=ProgressBar1.Progress+1;
State.Caption:='Initialising web extensions...';
Update;
Application.CreateForm(TWebExt, WebExt);
ProgressBar1.Progress:=ProgressBar1.Progress+1;
State.Caption:='Initialising user list...';
Update;
Application.CreateForm(TUserListInfo, UserListInfo);
ProgressBar1.Progress:=ProgressBar1.Progress+1;
State.Caption:='Initialising password windows...';
Update;
Application.CreateForm(TOperPassword, OperPassword);
ProgressBar1.Progress:=ProgressBar1.Progress+1;
State.Caption:='Initialising admin message editor...';
Update;
Application.CreateForm(TAdminEdit, AdminEdit);
ProgressBar1.Progress:=ProgressBar1.Progress+1;
State.Caption:='Initialising partyline window...';
Update;
Application.CreateForm(TPL_Channels, PL_Channels);
ProgressBar1.Progress:=ProgressBar1.Progress+1;
State.Caption:='Initialising MOTD editor...';
Update;
Application.CreateForm(TplineMOTD, plineMOTD);
ProgressBar1.Progress:=ProgressBar1.Progress+1;
State.Caption:='Initialising channels window...';
Update;
Application.CreateForm(TNamesListPopup, NamesListPopup);
ProgressBar1.Progress:=ProgressBar1.Progress+1;
State.Caption:='Initialising context help...';
Update;
Application.CreateForm(TCtxHelp, CtxHelp);
ProgressBar1.Progress:=ProgressBar1.Progress+1;
State.Caption:='Initialising DCC system...';
Update;
ProgressBar1.Progress:=ProgressBar1.Progress+1;
State.Caption:='Initialising plugin loader...';
Update;
Application.CreateForm(TPlgLoading, PlgLoading);
ProgressBar1.Progress:=ProgressBar1.Progress+1;
State.Caption:='Initialising plugin removal...';
Update;
Application.CreateForm(TUnloadPlg, UnloadPlg);
ProgressBar1.Progress:=ProgressBar1.Progress+1;
State.Caption:='Initialising user account editor...';
Update;
Application.CreateForm(TUserEdit, UserEdit);
ProgressBar1.Progress:=ProgressBar1.Progress+1;
State.Caption:='Initialising channel list...';
Update;
Application.CreateForm(TCList, CList);
ProgressBar1.Progress:=ProgressBar1.Progress+1;
State.Caption:='Initialising plugin auto loader...';
Update;
Application.CreateForm(TAutoLoadList, AutoLoadList);
ProgressBar1.Progress:=ProgressBar1.Progress+1;
State.Caption:='Initialising channel key window...';
Update;
Application.CreateForm(TKeyPrompt, KeyPrompt);
ProgressBar1.Progress:=ProgressBar1.Progress+1;
State.Caption:='Initialising channel selector...';
Update;
Application.CreateForm(TSelectChannel, SelectChannel);
ProgressBar1.Progress:=ProgressBar1.Progress+1;
State.Caption:='Initialising server window...';
Update;
Application.CreateForm(TServerAdd, ServerAdd);
ProgressBar1.Progress:=ProgressBar1.Progress+1;
State.Caption:='Initialising script event editor...';
Update;
Application.CreateForm(TAddEvent, AddEvent);
ProgressBar1.Progress:=ProgressBar1.Progress+1;
State.Caption:='Initialising script debug...';
Update;
Application.CreateForm(TDebugWindow, DebugWindow);
ProgressBar1.Progress:=ProgressBar1.Progress+1;
State.Caption:='Loading settings from WinBot.ini...';
Update;
// load settings here when all neccessary windows are created
WinBotLib.Emotes_Disable:=False;
LoadSettings(False);
ProgressBar1.Progress:=ProgressBar1.Progress+1;
State.Caption:='Completed!';
Update;
If WinBot.Trans.Position<>0 then
Begin
SetupTransparency(255-WinBot.Trans.Position,WinBot.Handle);
SetupTransparency(255-WinBot.Trans.Position,Protection.Handle);
SetupTransparency(255-WinBot.Trans.Position,IRCTerm.Handle);
SetupTransparency(255-WinBot.Trans.Position,Connecting.Handle);
SetupTransparency(255-WinBot.Trans.Position,Msg.Handle);
SetupTransparency(255-WinBot.Trans.Position,FingerWindow.Handle);
SetupTransparency(255-WinBot.Trans.Position,AutoOp.Handle);
SetupTransparency(255-WinBot.Trans.Position,PluginLst.Handle);
SetupTransparency(255-WinBot.Trans.Position,WebExt.Handle);
SetupTransparency(255-WinBot.Trans.Position,UserListInfo.Handle);
SetupTransparency(255-WinBot.Trans.Position,OperPassword.Handle);
SetupTransparency(255-WinBot.Trans.Position,AdminEdit.Handle);
SetupTransparency(255-WinBot.Trans.Position,PL_Channels.Handle);
SetupTransparency(255-WinBot.Trans.Position,PlineMOTD.Handle);
SetupTransparency(255-WinBot.Trans.Position,NamesListPopup.Handle);
SetupTransparency(255-WinBot.Trans.Position,CtxHelp.Handle);
SetupTransparency(255-WinBot.Trans.Position,PlgLoading.Handle);
SetupTransparency(255-WinBot.Trans.Position,UnloadPlg.Handle);
SetupTransparency(255-WinBot.Trans.Position,UserEdit.Handle);
SetupTransparency(255-WinBot.Trans.Position,CList.Handle);
SetupTransparency(255-WinBot.Trans.Position,AutoLoadList.Handle);
SetupTransparency(255-WinBot.Trans.Position,KeyPrompt.Handle);
SetupTransparency(255-WinBot.Trans.Position,SelectChannel.Handle);
SetupTransparency(255-WinBot.Trans.Position,ServerAdd.Handle);
SetupTransparency(255-WinBot.Trans.Position,AddEvent.Handle);
SetupTransparency(255-WinBot.Trans.Position,DebugWindow.Handle);
End;
WinBot.Show;
Free;
except
on E:Exception do
Begin
Free;
MessageBox(0,PChar('An error occured while creating windows - Do you have enough free resources to load WinBot?'#13#10+'Error type: '+E.Message),'Error',MB_OK+MB_ICONEXCLAMATION);
Halt;
End;
end;
Application.Run;
finally;
end;
end.