Draft
Conversation
Implements an event-driven script language.
Awaiting possible rewording in this PR due to renaming considerations.
Needs more work especially around escaping, this is unsafe to use on production servers.
Examples of scripts that currently work:
```
// When the server starts (or is rehashed)
on START:*:{
isupport SCRIPT=1.0
// global var in START event
var %count 0
}
// Add a new command /REPORT and send reports (as a privmsg from the server) to #staff channel
new COMMAND:REPORT:{
var %chan find_channel("#staff")
if (%chan.name == $null) {
sendnotice $client "Sorry, no staff are on right now"
return
}
else {
privmsg @%chan.name "[report] [nick: $client.name] [report: $1-]"
sendnotice $client "Thank you for your report."
}
}
// Do something when a client connects to the server
on CONNECT:*:{
%count++
sendnotice $client "You are the #%count connection!"
if ($client issecure) {
sendnotice $client "Thanks for using a secure connection!"
}
else {
sendnotice $client "Consider connecting with TLS!"
}
}
// Override the INVITE command and cry about it in #staff for some reason
on COMMAND:INVITE:{
privmsg #staff "$client.name used /INVITE $1-"
}
// New oper-only command which quiet-ban's a nick in a channel
new COMMAND:QUIETBAN:{
var %chan find_channel($1)
var %target find_client($2)
if ($client isoper) {
mode %chan.name +b ~quiet:*!*@$target.host
}
else {
notice $client "Permission denied"
}
}
new COMMAND:CUSTOMQUIT:{
svskill $client "Ping timeout: 204071794 years"
}
```
Contributor
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements an event-driven script language.
Awaiting possible rewording in this PR due to renaming considerations.
Needs more work especially around escaping, this is unsafe to use on production servers.
Examples of scripts that currently work: