Here's a more complex script that demonstrates multiple concepts:
on ^join:#mychannel { var $user = $nick echo Welcome, $user ! to #mychannel }
var $name = John alias greet { echo Hello, $name ! } In this example, the greet command will echo "Hello, John !" to the current channel or console.
alias chatbot { var $user = $nick var $message = $1- if ($message == !hello) { echo Hello, $user ! } } In this example, the chatbot script checks if the user types !hello and responds with "Hello, $user !".
Scoop uses variables to store and manipulate data. You can declare variables using the var keyword:
Scoop scripts can also respond to events, such as when a user joins or leaves a channel. You can use the on keyword to define event handlers: