Project

General

Profile

Added in 1.9.0

/sockmark <name> [text]

Assigns temporary data to a socket to be referenced later using $sock(<name>).mark. Leaving the [text] parameter $null will clear the socket mark. The sockmark command can be used to assign the same data to multiple sockets using a wildcard pattern.

Parameters

<name> - Socket to mark.
[text] - Text to add to the socket mark.

Example

; Non-functioning example, shows practical usage only
on $*:text:/^!foo (\S+)$/Si:#:{
  ; if ( .. validate input .. ) {
  sockopen sock1 www.example.com 80
  sockmark sock1 $regml(1)
}
on *:sockopen:sock1:{
  ; submit the information we got from the user 
  sockwrite -nt $sockname GET /foobar.php?q= $+ sock($sockname).mark HTTP/1.0
  sockwrite -nt $sockname Host: www.example.com
  sockwrite -nt $sockname $crlf
}
; on *:sockread:sock1: {
;    ....
; }

Updated by Per Amundsen over 3 years ago · 1 revisions

Also available in: PDF HTML TXT