TestMax.dk Paster
  • Forside
  • Print
  • Bookmark
  • Kontakt
  • SiteMap


infobox infobox
 

Q Auth :)

05-11-2009 23:57:27
 
 
Muligheder (Anmeld)
Skrevet af BlazerJenzo
Kliks 455
Kategori XChat scripting
Hvis du skulle falde a QuakeNet så er her et script som automatisk auth'er dig i Q når du kommer på igen :)


my $Q_auth_name = "dinauthher"; # Your Q AuthName
my $Q_auth_pass = "ditpassher"; # Your Q Password
my $recheck = 0; # Whether to periodically check you're still authed. (Netsplits and bouncers can de-auth you)
                                   # NOTE! Enabling this results in ALL Q chat being hidden from you!
my $modex = 1; # Whether to hide your IP/hostname from whois once authed. 1 = yes, 0=no.
my $attempts=3; # Number of failed attempts to auth before giving up.
my $check_intervals = 50000; # milliseconds between auth attempts and checks. 300000 = 5 minutes, 600000=10 minutes. 1800000=30 mins.
#
# End Config
#
# Startup registers
Xchat::register( "Flashy's Q Authing Script", "V.001", "Q_Auther", "" );
Xchat::hook_print( "Server Text", "qserver_watch"); # Watch for server messages for initial run.
Xchat::hook_print("Notice","qchat_watch"); # Hook Q's replies
my $check_timer;
my $cur_attempt=0;

Xchat::print("Flashy's Q Authing script loaded.");

if ($recheck == 1) {
       $check_timer=Xchat::hook_timer(50000,"check_qauth");
       check_qauth();
}

sub qserver_watch { # Called on messages from server. Tends not to work too well with bouncers.
       $qline = $_[0][0];
       if ($qline =~ /Welcome to the QuakeNet/) { # Change this is Qnet change their welcome string
                     Xchat::print("Found Quakenet connection string, attempting auto-auth for $Q_auth_name");
                     auth();
                     # Also add a +x to hide the IP (On quakenet this replaces your hostmask with *@authname.quakenet.org.
                     # Comment following line if for some insane reason you don't want that.
                     if ($modex == 1) { Xchat::command("umode +x"); }
                     }
return Xchat::EAT_NONE;
}

sub qchat_watch {       
       $qline = $_[0][1];
       # Auth check
       if ($recheck == 1) {
                     if ($qline =~ /You have authed as/ ) {
#                     Xchat::print("Received auth confirmation from Q");
                     $cur_attempt=0; # Reset counter as we're now authed.
                     }
                     if($qline =~ /You have NOT authed/ ) {
                            $cur_attempt++;
                            Xchat::print("Warning: Q Authorisation has failed, retrying. Attempt $cur_attempt/$attempts... (q.pl)");
                            auth();
                            }
              if ($recheck == 1) {
                     return Xchat::EAT_ALL; # Have to hide Q's notices or it'll spam the current chan.
                     } else { return Xchat::EAT_NONE; }
              }
}

sub check_qauth {
       Xchat::command("msg Q\@CServe.quakenet.org whoami");
       if ($cur_attempt+1 >= $attempts) {
              Xchat::print("Error: Auth attempt " . $cur_attempt+1 . " exceeds max attempts $attempts. Final attempt.");
              return Xchat::REMOVE;
              } else {       
              return Xchat::KEEP;
              }
}

sub auth {
       Xchat::command("msg Q\@CServe.quakenet.org auth $Q_auth_name $Q_auth_pass");
}


Husk det skal gemmes som en .pl fil da det er et Perl script :)
 
infobox infobox


infobox infobox
 
#1Drax(Anmeld) 06-11-2009 08:21:29
 
 
"one step for xchat script kind...." :D

Godt at se første perl / xchat tråd!

// code on
Administrator - TestMax.dk Stifter/Udvikler

Drax's signatur billede
 
infobox infobox

Påmindelse ved nyt svar

Ved at tilmelde dig automatisk påmindelse, modtager du en email så snart denne tråd bliver besvaret, dog sender vi kun en mail til dig, også selvom der er kommet flere svar, simpelthen for at spare dig for spam i din indbakke.


infobox infobox
  Svar på tråden  
   
 
 
infobox infobox

infobox infobox
  Læs dette før du sender dit indlæg!  
 
Ved tryk på send knappen accepterer du vores regelsæt som kan læses her
Praktiske informationer
Type Eksempel Resultat
Fed [b]din tekst[/b] din tekst
Kursiv [k]din tekst[/k] din tekst
Understreg [u]din tekst[/u] din tekst
Kode felt [code]din tekst[/code]
din tekst
infobox infobox