Skip to content

Commit c4c10b4

Browse files
committed
cleanup
1 parent c5e47c3 commit c4c10b4

19 files changed

+267
-285
lines changed

resources/irc/logs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
fileClose(file)
2020
*>
2121
</body>
22-
22+
</html>

resources/irc/meta.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,17 +103,17 @@
103103
</settings>
104104

105105
<!-- Don't touch anything below! -->
106-
<info author="MCvarial" version="1.0.5" type="misc" name="irc" description="Echobot to be used on irc" />
106+
<info author="MCvarial" version="1.0.6" type="misc" name="irc" description="Echobot to be used on irc" />
107107

108108
<export function="ircGetChannelFromName" type="server" http="false" />
109109
<export function="ircGetEchoChannels" type="server" http="false" />
110110
<export function="ircGetChannelServer" type="server" http="false" />
111111
<export function="ircGetChannels" type="server" http="false" />
112112
<export function="ircSetChannelMode" type="server" http="false" />
113113
<export function="ircGetChannelName" type="server" http="false" />
114-
<export function="ircGetChannelMode" type="server" http="false" />
115114
<export function="ircGetChannelUsers" type="server" http="false" />
116115
<export function="ircGetChannelTopic" type="server" http="false" />
116+
<export function="ircGetChannelPassword" type="server" http="false" />
117117
<export function="ircIsEchoChannel" type="server" http="false" />
118118
<export function="ircRaw" type="server" http="false" />
119119
<export function="ircHop" type="server" http="false" />
@@ -136,7 +136,6 @@
136136
<export function="ircIsServerSecure" type="server" http="false" />
137137
<export function="ircGetServerChannels" type="server" http="false" />
138138
<export function="ircSetUserMode" type="server" http="false" />
139-
<export function="ircGetUserMode" type="server" http="false" />
140139
<export function="ircGetUserChannels" type="server" http="false" />
141140
<export function="ircGetUserNick" type="server" http="false" />
142141
<export function="ircGetUserServer" type="server" http="false" />
@@ -159,7 +158,6 @@
159158
<script src="scripts/users.lua" type="server" />
160159
<script src="scripts/handling.lua" type="server" />
161160
<script src="scripts/commands.lua" type="server" />
162-
<script src="scripts/levels.lua" type="server" />
163161
<script src="scripts/acl.lua" type="server" />
164162
<script src="scripts/ads.lua" type="client" />
165163
<script src="scripts/echo.lua" type="server" />

resources/irc/scripts/acl.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
-- Project: irc
33
-- Author: MCvarial
44
-- Contact: [email protected]
5-
-- Version: 1.0.3
5+
-- Version: 1.0.6
66
-- Date: 31.10.2010
77
---------------------------------------------------------------------
88

resources/irc/scripts/ads.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
-- Project: irc
33
-- Author: MCvarial
44
-- Contact: [email protected]
5-
-- Version: 1.0.3
5+
-- Version: 1.0.6
66
-- Date: 31.10.2010
77
---------------------------------------------------------------------
88

resources/irc/scripts/channels.lua

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@
22
-- Project: irc
33
-- Author: MCvarial
44
-- Contact: [email protected]
5-
-- Version: 1.0.3
5+
-- Version: 1.0.6
66
-- Date: 31.10.2010
77
---------------------------------------------------------------------
88

99
-- everything is saved here
10-
channels = {} -- syntax: [channel] = {string name,string mode,string topic,table users,string password,bool joined,bool echo}
10+
channels = {} -- syntax: [channel] = {name=string, topic=string, users=table, password=string, echochannel=bool}
1111

1212
------------------------------------
1313
-- Channels
1414
------------------------------------
15-
function func_ircGetChannelFromName (channel)
15+
function func_ircGetChannelFromName (channel,server)
1616
for i,chan in ipairs (ircGetChannels()) do
17-
if string.lower(ircGetChannelName(chan)) == string.lower(channel) then
17+
if string.lower(ircGetChannelName(chan)) == string.lower(channel) and (getElementParent(chan) == server or not server) then
1818
return chan
1919
end
2020
end
2121
return false
2222
end
23-
registerFunction("ircGetChannelFromName","func_ircGetChannelFromName","string")
23+
registerFunction("ircGetChannelFromName","func_ircGetChannelFromName","string","(irc-server)")
2424

2525
function func_ircGetEchoChannels ()
2626
local channels = {}
@@ -58,26 +58,30 @@ end
5858
registerFunction("ircSetChannelMode","func_ircSetChannelMode","irc-channel","string")
5959

6060
function func_ircGetChannelName (channel)
61-
return channels[channel][1]
61+
return channels[channel].name
6262
end
6363
registerFunction("ircGetChannelName","func_ircGetChannelName","irc-channel")
6464

65-
function func_ircGetChannelMode (channel)
66-
return channels[channel][2]
67-
end
68-
registerFunction("ircGetChannelMode","func_ircGetChannelMode","irc-channel")
69-
7065
function func_ircGetChannelUsers (channel)
71-
return channels[channel][4]
66+
local t = {}
67+
for user,level in pairs (channels[channel].users) do
68+
table.insert(t,user)
69+
end
70+
return t
7271
end
7372
registerFunction("ircGetChannelUsers","func_ircGetChannelUsers","irc-channel")
7473

7574
function func_ircGetChannelTopic (channel)
76-
return channels[channel][3]
75+
return channels[channel].topic
7776
end
7877
registerFunction("ircGetChannelTopic","func_ircGetChannelTopic","irc-channel")
7978

79+
function func_ircGetChannelPassword (channel)
80+
return channels[channel].password
81+
end
82+
registerFunction("ircGetChannelPassword","func_ircGetChannelPassword","irc-channel")
83+
8084
function func_ircIsEchoChannel (channel)
81-
return channels[channel][7]
85+
return channels[channel].echochannel
8286
end
8387
registerFunction("ircIsEchoChannel","func_ircIsEchoChannel","irc-channel")

resources/irc/scripts/commands.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
-- Project: irc
33
-- Author: MCvarial
44
-- Contact: [email protected]
5-
-- Version: 1.0.3
5+
-- Version: 1.0.6
66
-- Date: 31.10.2010
77
---------------------------------------------------------------------
88

resources/irc/scripts/echo.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
-- Project: irc
33
-- Author: MCvarial
44
-- Contact: [email protected]
5-
-- Version: 1.0.3
5+
-- Version: 1.0.6
66
-- Date: 31.10.2010
77
---------------------------------------------------------------------
88

0 commit comments

Comments
 (0)