Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
abd59146
Commit
abd59146
authored
13 years ago
by
mcmlxxix
Browse files
Options
Downloads
Patches
Plain Diff
add quote and addquote commands (and fix them too)
parent
2063dc60
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
exec/load/ircbot_commands.js
+37
-0
37 additions, 0 deletions
exec/load/ircbot_commands.js
with
37 additions
and
0 deletions
exec/load/ircbot_commands.js
+
37
−
0
View file @
abd59146
...
...
@@ -226,6 +226,43 @@ Bot_Commands["IDENT"].command = function (target,onick,ouh,srv,lvl,cmd) {
return
;
}
Bot_Commands
[
"
ADDQUOTE
"
]
=
new
Bot_Command
(
80
,
true
,
false
);
Bot_Commands
[
"
ADDQUOTE
"
].
command
=
function
(
target
,
onick
,
ouh
,
srv
,
lvl
,
cmd
)
{
cmd
.
shift
();
var
the_quote
=
cmd
.
join
(
"
"
);
Quotes
.
push
(
the_quote
);
srv
.
o
(
target
,
"
Thanks for the quote!
"
);
return
;
}
Bot_Commands
[
"
QUOTE
"
]
=
new
Bot_Command
(
0
,
false
,
false
);
Bot_Commands
[
"
QUOTE
"
].
command
=
function
(
target
,
onick
,
ouh
,
srv
,
lvl
,
cmd
)
{
if
(
Quotes
.
length
==
0
)
{
srv
.
o
(
target
,
"
I have no quotes. :(
"
);
return
;
}
if
(
cmd
[
1
])
{
cmd
.
shift
();
var
searched_quotes
=
new
Object
();
var
search_params
=
cmd
.
join
(
"
"
);
var
lucky_number
;
while
(
true_array_len
(
searched_quotes
)
<
Quotes
.
length
)
{
lucky_number
=
random
(
Quotes
.
length
);
if
(
!
searched_quotes
[
lucky_number
])
{
if
(
Quotes
[
lucky_number
].
toUpperCase
().
match
(
search_params
.
toUpperCase
()))
{
srv
.
o
(
target
,
Quotes
[
lucky_number
]);
return
;
}
searched_quotes
[
lucky_number
]
=
true
;
}
}
srv
.
o
(
target
,
"
Couldn't find a quote that matches your criteria.
"
);
return
;
}
srv
.
o
(
target
,
quotes
[
random
(
Quotes
.
length
)]);
return
;
}
Bot_Commands
[
"
GREET
"
]
=
new
Bot_Command
(
50
,
false
,
false
);
Bot_Commands
[
"
GREET
"
].
usage
=
get_cmd_prefix
()
+
"
GREET <greeting>,
"
+
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment