Advertisement
SReject

Untitled

Jan 7th, 2020
625
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.25 KB | None | 0 0
  1. alias ui1_inputTest {
  2.  
  3.   ;; DATA TO PASS INTO THE THE COM AS A UI1 ARRAY: text\0text2
  4.   bset -t &ui1_data -1 text1
  5.   bset &ui1_data -1 0
  6.   bset -t &ui1_data -1 text2
  7.  
  8.   echo -s bvar size: $bvar(&ui1_data, 0) (should be 10)
  9.  
  10.  
  11.   .comopen ui1_test ADODB.Stream
  12.   if (!$com(ui1_test) || $comerr) {
  13.     echo -a failed to create stream instance
  14.   }
  15.   elseif (!$com(ui1_test, open, 1) || $comerr) {
  16.     echo -a Failed to open stream
  17.   }
  18.   elseif (!$com(ui1_test, type, 4, integer, 1) || $comerr) {
  19.     echo -a Failed to set the read/write type to binary
  20.   }
  21.  
  22.  
  23.   ;; THIS LINE PASSES THE BVAR IN AS A VT_ARRAY<ui1>
  24.   elseif (!$com(ui1_test, write, 1, array &ui1, &ui1_data) || $comerr) {
  25.     echo -a Failed to write data to stream
  26.   }
  27.  
  28.  
  29.   elseif (!$com(ui1_test, position, 4, integer, 0) || $comerr) {
  30.     echo -a Failed to reset position
  31.   }
  32.   elseif (!$com(ui1_test, saveToFile, 1, bstr, $mircdirui1_text.txt, integer, 2) || $comerr) {
  33.     echo -a Failed to save to file
  34.   }
  35.   elseif (!$com(ui1_test, close, 1) || $comerr) {
  36.     echo -a Failed to close stream
  37.   }
  38.   else {
  39.     echo -a All done; wrote to $mircdirui1_text.txt
  40.     run $mircdirui1_text.txt
  41.   }
  42.  
  43.   if ($com(ui1_test)) {
  44.     .comclose ui1_test
  45.   }
  46.  
  47.   .remove $mircdircui1_text.txt
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement