From WikiChip
Difference between revisions of "mirc/identifiers/$inpaste"
< mirc‎ | identifiers

m
Line 1: Line 1:
{{mirc title|$inpaste Identifier}}'''$inpaste''' returns $true if a user typed Control+V or Shift+Insert to paste text into an editbox, mainly useful when processing an {{mIRC|on events/on input|on input}} event.
+
{{mirc title|$inpaste Identifier}}'''$inpaste''' returns $true if a user triggered the {{mIRC|on events/on input|ON INPUT}} event by pressing Control+V or Shift+Insert to paste text into an editbox or using the 'Paste' choice from the editbox's right-click menu.
  
 +
It appears that $inpaste is mostly $false, and can be $true only when:
  
 +
# Options/Display/Other/'Editbox Lines' is set to 'Single'
 +
# Clipboard contains at least one of $cr $lf $crlf
 +
# Paste from the clipboard triggers the ON INPUT event
 +
# $inpaste is used within the ON INPUT or ON PARSELINE:out event
 
== Synopsis ==
 
== Synopsis ==
 
<pre>$inpaste</pre>
 
<pre>$inpaste</pre>
 
 
== Paramters ==
 
== Paramters ==
 
 
None
 
None
 
 
== Properties ==
 
== Properties ==
 
 
None
 
None
 +
== Example ==
 +
<source lang="mIRC">
 +
on *:INPUT:*:{ if ( ($istok(/ $comchar,$left($strip($1),1),32)) && (!$ctrlenter) && ($inpaste)) { echo -g Preventing this pasted /command from being executed: $1- | halt } }</source>
  
== Example ==
 
 
<source lang="mIRC">
 
<source lang="mIRC">
on *:input:*:{
+
on *:PARSELINE:out:*:{ echo -s debug $scriptline $event : $inpaste is $true only if this line was triggered by pasting from the clipboard : $parseline }
echo -a $inpaste
+
</source>
}</source>
 
  
 
== Compatibility ==
 
== Compatibility ==
 
{{mIRC compatibility|5.8}}
 
{{mIRC compatibility|5.8}}
 
 
== See also ==
 
== See also ==
{{mIRC|on events/on input|on input}}
+
* {{mIRC|on events/on input|ON INPUT}}
{{mIRC|$ctrlenter}}
+
* {{mIRC|on events/on input|ON PARSELINE}}
[[Category:mIRC identifiers|inpaste]]
+
* {{mIRC|$ctrlenter}}
 +
* {{mIRC|$comchar}}

Revision as of 15:11, 4 January 2020

$inpaste returns $true if a user triggered the ON INPUT event by pressing Control+V or Shift+Insert to paste text into an editbox or using the 'Paste' choice from the editbox's right-click menu.

It appears that $inpaste is mostly $false, and can be $true only when:

  1. Options/Display/Other/'Editbox Lines' is set to 'Single'
  2. Clipboard contains at least one of $cr $lf $crlf
  3. Paste from the clipboard triggers the ON INPUT event
  4. $inpaste is used within the ON INPUT or ON PARSELINE:out event

Synopsis

$inpaste

Paramters

None

Properties

None

Example

on *:INPUT:*:{ if ( ($istok(/ $comchar,$left($strip($1),1),32)) && (!$ctrlenter) && ($inpaste)) { echo -g Preventing this pasted /command from being executed: $1- | halt } }
on *:PARSELINE:out:*:{ echo -s debug $scriptline $event : $inpaste is $true only if this line was triggered by pasting from the clipboard : $parseline }

Compatibility

Added: mIRC v5.8
Added on: 05 Sep 2000
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.

See also