Project

General

Profile

Actions

Sockmark » History » Revision 1

Revision 1/3 | Next »
Per Amundsen, 02/15/2014 07:15 PM


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 10 years ago · 1 revisions

Also available in: PDF HTML TXT