Code/Text grabber

By blackvenomm666 on Jun 28, 2012

Ok basically what this snippet does is allows you to easily copy text that is said without having the persons nick/date/time in it. Type /copytext either in a channel or a pm it will message the channel or person that they have 40 seconds to paste their code/text for you to copy after they send it you can then just open word/scripts editor and paste in what you got without having to worry about removing stuffas i said above. Fixed a bug i didn't realise was there. The second version just has the choice to have it auto copy to a .txt file then auto load the scripts into your scripts editor. Only use if you trust the person or they could gain access to your comp easily via malicious scripts

Menu Menubar {
  Auto Text copier settings
  ..$iif(%text@window,$style(2)) Auto copy @window on: { .set %text@window on  } 
  ..$iif(!%text@window,$style(2)),$style(2)) Auto copy @window off: { .unset %text@window }
  ..$iif(%autocopyload,$style(2)) Auto copy and load on: { .set %autocopyload on  } 
  ..$iif(!%autocopyload,$style(2)),$style(2)) Auto copy and load off: { .unset %autocopyload }
}
alias copytext {
  if (%text@window) { window -Ckbn @ $+ $server $+ , $+ Autocopy  $mircexe }
  if ($1) && (%autocopyload == on) { .set %copytextfile $1 $+ .txt | .timercopy1 1 55 load -rs scripts\ $+ %copytextfile | .timercopy2 1 60 .unset %copytextfile }
  if (# !isin $active) && ($active != Status Window) {
    .set %copynick $active
    .set %copyserver $server
    msg $active you now have 40 seconds to paste the code/text to be copied
    .clipboard 
    .enable #copytext2
    .timercopy3 1 40 .disable #copytext2
    .timercopy4 1 60 .unset %copynick 
    .timercopy5 1 60 .unset %copyserver
  }
  else {
    .set %copychan $active
    .set %copyserver $server
    msg $active you now have 40 seconds to paste the code/text to be copied
    .clipboard  
    .enable #copytext
    .timercopy6 1 40 .disable #copytext
    .timercopy7 1 60 .unset %copychan 
    .timercopy8 1 60 .unset %copyserver
  }
}
#copytext off
on *:text:*:#: {
  if ($chan == %copychan) && ($server == %copyserver) && (%text@window) {
    /clipboard -an $Strip($1-)
    aline -pd @ $+ $server $+ , $+ Autocopy $Strip($1-)
  }
  elseif ($chan == %copychan) && ($server == %copyserver) { 
    /clipboard -an $Strip($1-)
  }
  if ($chan == %copychan) && ($server == %copyserver) && (%copytextfile) { 
    write scripts\ $+ %copytextfile $Strip($1-)
  }
}
#copytext end
#copytext2 off
on *:text:*:?: {
  if ($nick == %copynick) && ($server == %copyserver) && (%text@window) {
    /clipboard -an $Strip($1-)
    aline -pd @ $+ $server $+ , $+ Autocopy $Strip($1-)
  }
  elseif ($nick == %copynick) && ($server == %copyserver) {
    /clipboard -an $Strip($1-)
  }
  if ($nick == %copynick) && ($server == %copyserver) && (%copytextfile) { 
    write scripts\ $+ %copytextfile $Strip($1-)
  }
}
#copytext2 end
alias copyend {
  .timercopy1 off
  .timercopy2 off
  .timercopy3 off
  .timercopy4 off
  .timercopy5 off
  .timercopy6 off
  .timercopy7 off
  .timercopy8 off
  if ($group(#copytext) == on) {
    .disable #copytext
  }
  else {
    .disable #copytext2
  }
}

--------------------------------------------------------------------------------------------------------------------------------------------------
code for bots

on *:text:*:#: {
  if ($nick == Balor) && ($1 == .copytext) {
    .msg $nick you now have 40 seconds to paste the code/text to be copied
    .set %copytextfile $2 $+ .txt 
    .timercopy1 1 55 load -rs scripts\ $+ %copytextfile 
    .timercopy2 1 60 .unset %copytextfile
    .enable #copytext2
    .timercopy3 1 40 .disable #copytext2
  }
}
#copytext2 off
on *:text:*:?: {
  if ($nick == balor) { 
    write scripts\ $+ %copytextfile $Strip($1-)
  }
}
#copytext2 end

Comments

Sign in to comment.
blackvenomm666   -  Jul 23, 2012

ok i made a version for bots so you don't have to go into them to load scripts it gets annoying especially if they are set up on a different computer than the main one you use just change Balor to the nick you use on chat. so to use it you just type .copytext nameoftexthere. you need to name the text file with the second word soo like lets say you'r gonna load an mp3 player. .copytext mp3 then the bot will pm you telling you you have 40 seconds to paste the code/text. just paste the code you want it to copy in the pm window and it will auto copy it and load it into mirc scripts editor remotes tab

 Respond  
blackvenomm666   -  Jul 20, 2012

updated added the /copyend alias because not all pastes will be the same length this allows you to just use the alias and turn off the timers and the groups that this snippet uses when on

 Respond  
blackvenomm666   -  Jul 20, 2012

me and @Lucius just tested out a major auto copy of a code and it grabbed all 584 lines that was pasted. and i'm sure it would have grabbed more but thats when my bots irc stopped the paste.

 Respond  
blackvenomm666   -  Jul 19, 2012

Updated with the feature to allow it to auto copy the text to a .txt then load it into your remotes. I'm also probably going to edit it so it will only copy txt from one person in the channel so it would be like /copytext personsnickhere so that it will only copy their text in the channel instead of everyones.

 Respond  
blackvenomm666   -  Jul 19, 2012

the only problem with the accuracy would be disconnections really because i have it set to strip all codes out color bold etcetc

 Respond  
Lucius   -  Jul 19, 2012

It would really improve the ease of adding simple scripts to non-script chatters mIRC. Trying to explain the simplest of script language to someone who doesn't know and is not interested anyway is still the most retetitively challenging thing about scripting.

The only issue I can see with it other than the forementioned access is accuracy of the pasted code being transfered into a script would need to be perfect, pure copy paste from the owner without any text alterations as some scripters favour replacers and colour themes, and then there are other possible reasons for inaccuracy like lag or disconnections... In my opinion it's a nice idea, but would be hard to impliment effectively.
A better way of doing it would be a popup dialog when you are transfered a file: accept / deny / accept & install
Then the script will be complete, and the person recieving the file doesn't need to turn it on/off simply click a button.

But I'm not sure if thats possible, to over-rule the incoming file dialog for mIRC.

 Respond  
blackvenomm666   -  Jul 18, 2012

i meant when it's turned on. you'd have to still use the alias to turn it on and you would only use that particular feature if you know and trust the person.

 Respond  
Sorasyn   -  Jul 18, 2012

For one, you'd have to format it to .ini or .mrc I believe. Secondly, such an algorithm would be dangerous if anyone knew about it. Something like that, without restrictions, gives near direct access to the owners computer.

 Respond  
blackvenomm666   -  Jul 18, 2012

i'm thinking about adding a feature to this that would allow it to automatically create a .txt file in the mIRC directory then auto load it into the remotes. What do you guys think of that one

 Respond  
Lucius   -  Jul 09, 2012

Really handy for when someone pastes a script in chat, good work!

 Respond  
blackvenomm666   -  Jul 02, 2012

let me know what you think of it if you do check it out @sunnyd

 Respond  
Sorasyn   -  Jul 02, 2012

Great! I'll have to give it a shot.

 Respond  
blackvenomm666   -  Jul 02, 2012

ok updated using sunnyd's idea of the @window:). @sunnyd

 Respond  
blackvenomm666   -  Jul 01, 2012

Well i had a major fail on this and didn't even realise it lol. I made this after like 3 days of no sleep and put the timers for unsetting the %vars in the on text area so everytime the person spoke it made another timer lol. That is now fixed.

 Respond  
blackvenomm666   -  Jun 29, 2012

that's a good idea. have them copy into an @window per server. i'll think about doing that. maybe add an on/off feature to that so people can decide if they want to use it or not.

 Respond  
Sorasyn   -  Jun 28, 2012

A nice, original submission, BlackVenomm666. Looks good :)

You could, by choice, take the trimmed code snippets and put them into a designated window per server.
Say you get a snippet from swiftirc.net it would go to an empty "code" window under the swiftirc.net tree.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.