Jump to content

chain

Administrators
  • Posts

    5,964
  • Joined

  • Last visited

  • Days Won

    17

Posts posted by chain

  1. n @*:text:*:#:{
      var %s = 1,%ss = $lines(reklam.txt)
      while %s <= %ss {
        if $+(*,$read(reklam.txt,%s),*) iswm $1- {
          var %o = $remove($v1,*),%p = $regsub(%o,/(a|e|i|u|ü|o|ö|[A-Z])/gi,$chr(42)\1,%o)
          ban -k # $nick 2 Yasaklı kelime kullandınız: %o
        }
        inc %s
      }
    }
    
    Kullanımı : Reklam.txt içerisindeki kelimeler üzerinde işlev yapar.
    
    Diğer bir kullanım ise
    
    alias ok {
      var %1 = $1-
      var %2 = $regsub(%1,/(a|e|i|u|ü|o|ö|ı)/gi,$chr(42)\1,%1)
      return %1
    }
    
    Örneğin; //echo -: $ok(Bilirmisin?) yaptığında;B*l*r*m*s*n? şeklinde olucak,tır : )

     

  2. #otokomut on
    on *:input:*: {
      if ($1 == !kick) { /kick # $2 4 $me İyi Yolculuklar Diler. }
      if ($1 == !ban) { /ban -u600 $2 }
      if ($1 == !kb) { /ban -u600 $2 | /kick # $2 4 $me İyi Yolculuklar Diler. }
      if ($1 == !gel) { /msg # 2 $2 4Getiriliyor... | /sajoin $2 # }
      if ($1 == !git) { /msg # 2 $2 4Gönderiliyor... | /sapart $2 # }
      if ($1 == !cs) { /Chanserv $2 # $3 $4 $5 $6 $7 $8 $9 $10 $11 $12 $13 $14 $15 $16 $17 $18 $19 $20 $21 $22 $23 $24 $25 $26 $27 $28 $29 $30 $31 $32 $33 $34 $35 $36 $37 $38 $39 $40 $41 $42 $43 $44 $45 $46 $47 $48 $49 $50 $51 $52 $53 $54 $55 $56 $57 $58 $59 $60 }
      if ($1 == !ms) { /Memoserv $2 $3 $4 $5 $6 $7 $8 $9 }
      if ($1 == !os) { /Operserv $2 $3 $4 $5 $6 $7 $8 $9 }
      if ($1 == !ns) { /Nickserv $2 $3 $4 $5 $6 $7 $8 $9 }
      if ($1 == !info) { /ns info $2 all }
      if ($1 == !infochan) { /cs info # all }
      if ($1 == !founder) { /cs set # founder $2 }
      if ($1 == !mlock) { /cs set # mlock $2 }
      if ($1 == !privateon) { /cs set # private on }
      if ($1 == !privateoff) { /cs set # private off }
      if ($1 == !secureon) { /cs set # secure on }
      if ($1 == !secureoff) { /cs set # secure off }
      if ($1 == !enforceon) { /cs set # enforce on }
      if ($1 == !enforceoff) { /cs set # enforce off }
      if ($1 == !topic) { /cs topic # $2 $3 $4 $5 $6 $7 $8 $9 $10 $11 $12 $13 $14 $15 $16 $17 $18 $19 $20 $21 $22 $23 $24 $25 $26 $27 $28 $29 $30 $31 $32 $33 $34 $35 $36 $37 $38 $39 $40 $41 $42 $43 $44 $45 $46 $47 $48 $49 $50 $51 $52 $53 $54 $55 $56 $57 $58 $59 $60 }
      if ($1 == !successor) { /cs set # successor $2 }
      if ($1 == !unban) { /cs unban #$2 }
      if ($1 == !opekle) { /cs access # add $2 50 }
      if ($1 == !opsil) { /cs access # del $2 } 
      if ($1 == !sopekle) { /cs access # add $2 100 }
      if ($1 == !oplist) { /cs access # list } 
      if ($1 == !hopekle) { /cs access # add $2 40 }
      if ($1 == !gir) { /join #$2 }
      if ($1 == !voice) { /cs voice # $2 }
      if ($1 == !devoice) { /cs devoice # $2 }
      if ($1 == !op) { /cs op # $2 }
      if ($1 == !deop) { /cs deop # $2 }
      if ($1 == !ownerim) { /mode # +q $me }
      if ($1 == !deownerim) { /mode # -q $me }
      if ($1 == !owner) { /mode # +q $2 }
      if ($1 == !deowner) { /mode # -q $2 }
      if ($1 == !sop) { /Os raw :Chanserv mode # +o $2 | /Os raw :Chanserv mode # +a $2 }
      if ($1 == !desop) { /Os raw :Chanserv mode # -o $2 | /Os raw :Chanserv mode # -a $2 }
      if ($1 == !hop) { /cs halfop # $2 }
      if ($1 == !dehop) { /cs dehalfop # $2 }
      if ($1 == !awayon) { /away Uzaklardayım... }
      if ($1 == !awayoff) { /away }
      if ($1 == !kill) { /kill $2 4 $me İyi Yolculuklar Diler. }
      if ($1 == !zline) { /zline $2 4 $me İyi Yolculuklar Diler. }
      if ($1 == !shun) { /shun $2 4 $me Sana 3 Maymunu Oynatıyor. }
      if ($1 == !bye) { /kill $2 4 $me İyi Yolculuklar Diler. }
      if ($1 == !opum) { /mode # +o $me }
      if ($1 == !deopum) { /mode # -o $me }
      if ($1 == !voicem) { /mode # +v $me }
      if ($1 == !devoicem) { /mode # -v $me }
      if ($1 == !sopum) { /mode # +o $me | /mode # +a $me }
      if ($1 == !desopum) { /mode # -a $me | /mode # -o $me }
      if ($1 == !hopum) { /mode # +h $me }
      if ($1 == !dehopum) { /mode # -h $me }
      if ($1 == !nick) { /os raw svsnick $2 $3 1:0 }
      if ($1 == !botnick) { /os raw $2 nick $3 }
      if ($1 == !botgel) { /os raw $2 join # }
      if ($1 == !botgit) { /os raw $2 part # }
      if ($1 == !botde) { /os raw $2 privmsg # $3 $4 $5 $6 $7 $8 $9 }
      if ($1 == !sessiz) { /mode # +m }
      if ($1 == !mode) { /mode # $2 }
      if ($1 == !sesli) { /mode # -m }
      if ($1 == !sakin) { /mode # +m | /msg # !temizle | .timer34 1 60 /mode # -m }
    }
    #otokomut end
    
    menu menubar,channel {
      Oto Komutlar
      .Aç:.enable #otokomut | echo -a 4,1..::Oto Komutlar Açıldı::..
     .Kapat:.disable #otokomut | echo -a 4,1..::Oto Komutlar Kapandı:..
      -
    }

     

  3. on *:text:*:#KANAL: {
      if ($1 == !duyuru) {
        if !$hget(duyuru,$nick) { 
          .hadd -msu120 duyuru $nick 1 
          msg #Kanal  MESAJINIZ
          msg #Kanal MESAJINIZ
          return 
        }
        else { 
          .notice $nick 2 dk içerisinde bir defa duyuru komutunu kullanabilirsiniz .
        }
      }
    }

    Belirlediğiniz kanal içerinse 2 dk bir kullanabileceginiz bir remote'dir. Süre dilediğiniz kadar çoğaltabilirsiniz .

    Kullanımı : 
    !duyuru

  4. IRC sunucusunda eklenen, silinen ve düzenlenen spamları bir pencerede takip etmenize yarayan kod.

    on *:dialog:spam:*:*: {
    if $devent == sclick {
    if $did == 35 { set %tspamsil on | spamfilter }
    if $did(4).state == 1 { set %yaptirim zline }
    if $did(3).state == 1 { set %yaptirim gline }
    if $did(9).state == 1 { set %yaptirim kline }
    if $did(5).state == 1 { set %yaptirim gzline }
    if $did(1).state == 1 { set %yaptirim shun }
    if $did(7).state == 1 { set %yaptirim tempshun }
    if $did(6).state == 1 { set %yaptirim block }
    if $did(2).state == 1 { set %yaptirim dccblock }
    if $did(8).state == 1 { set %yaptirim kill }
    if $did(12).state == 1 { set %yaptirim1 c }
    else { unset %yaptirim1 }
    if $did(17).state == 1 { set %yaptirim2 N }
    else { unset %yaptirim2 }
    if $did(20).state == 1 { set %yaptirim3 q }
    else { unset %yaptirim3 }
    if $did(13).state == 1 { set %yaptirim4 p }
    else { unset %yaptirim4 }
    if $did(15).state == 1 { set %yaptirim5 n }
    else { unset %yaptirim5 }
    if $did(18).state == 1 { set %yaptirim6 p }
    else { unset %yaptirim6 }
    if $did(14).state == 1 { set %yaptirim7 t }
    else { unset %yaptirim7 }
    if $did(19).state == 1 { set %yaptirim8 a }
    else { unset %yaptirim8 }
    if $did(16).state == 1 { set %yaptirim9 d }
    else { unset %yaptirim9 }
    if $did(23) != $null { set %ssure $did(23) }
    if $did(25) != $null { set %ssebep $did(25) }
    if $did(28) != $null { set %skelime $did(28) }
    if $did == 34 { /spamfilter }
    if $did == 33 { /spamfilter del $$?”Parametreyi Yazınız. Yani Neleri Yasakladıgınızı Özel Msg Kanal Msg Quit,Topic Vb.” $$?”Ceza Türünü Yazınız Zline,Gline Vb.”   $$?”Cezai Kelimeyi(Sileceğiniz Kelimeyi) Yazınız }
    if $did == 32 { spamfilter add %yaptirim1 $+ %yaptirim2 $+ %yaptirim3 $+ %yaptirim4 $+ %yaptirim5 $+ %yaptirim6 $+ %yaptirim7 $+ %yaptirim8 $+ %yaptirim9 %yaptirim $did(23) $+ d $did(25) $did(28) }
    if $did == 35 { set %tspamsil on | spamfilter }
    }
    if $devent == init {
    if %yaptirim == zline { did -c $dname 4 }
    if %yaptirim == gline { did -c $dname 3 }
    if %yaptirim == kline { did -c $dname 9 }
    if %yaptirim == gzline { did -c $dname 5 }
    if %yaptirim == shun { did -c $dname 1 }
    if %yaptirim == tempshun { did -c $dname 7 }
    if %yaptirim == block { did -c $dname 6 }
    if %yaptirim == dccblock { did -c $dname 2 }
    if %yaptirim == kill { did -c $dname 8 }
    did -a $dname 23 %ssure
    did -a $dname 25 %ssebep
    did -a $dname 28 %skelime
    }
    if $devent == close {
    unset %yaptirim*
    }
    }
    raw 229:*: {
    if %tspamsil == on {
    /spamfilter del $3 $4 $7 $8 $10-
    .timerufuk2 1 2 unset %tspamsil
    .timerufuk 1 2 echo -as 4Tüm Spamlar Silindi. Eğer Silinmeyen Varsa Unrealircd.Conftan Kaldırmalısınız.
    }
    $iif(!$window(@SpamFiLter),window -nC @SpamFiLter) {
    echo -e @SpamFilter 12Atılan Parametreler:4 $qt($3) 12Ceza Türü:4 $qt($4) 12Atılma Süresi:4 $qt($6) 12Atılma Sebebi:4 $qt($8) 12Atılan Kelime:4 $qt($remove($10,:)) 12Atan Nick:4 $qt($gettok($9,1,33)) $qt(10SPAMI SİL)
    haltdef
    }
    }
    on ^*:snotice:*: {
    if $2 == removed && $3 == spamfilter {
    $iif(!$window(@biLgi),window -nC @biLgi) {
    echo -et @biLgi 7»º» 10[Spamfilter] 1Hareket: 12[KALDIRMA] 1Kaldıran Nick:4 $gettok($1,1,33) 1Kaldırılan Kelime:4 $remove($4,’) | halt
    }
    }
    if $2 == Spamfilter && $3 == added: {
    $iif(!$window(@biLgi),window -nC @biLgi) {
    echo -et @biLgi 7»º» 10[Spamfilter] 1Hareket: 12[Aktif Etme] 1Atan Nick:4 $gettok($19,1,33) 1Atılan Parametreler: 4 $remove($6,]) 1 1Atılma Sebebi:4 $remove($10,]) 1Atılan Kelime:4 $remove($4,’) | halt
    }
    }
    if $1 == [Spamfilter] && $3 == matches && $4 == filter {
    $iif(!$window(@biLgi),window -nC @biLgi) {
    echo -et @biLgi 7»º» 10[SPAMFİLTER TAKILMA] 12Takılan Nick:4 $gettok($2,1,33) 12Takılan İp:4 $gettok($2,2,64) 3Spamdaki Ekli Kelime:4 $remove($5,:,’) 7Userin Yazdığı Kelime:4 $remove($8-,’,]) | halt
    }
    }
    }

     

  5. Supybot is dead, long live Limnoria
    
    A long time ago in a galaxy far, far away... Supybot was maintained.
    
    For years, there have been idle threats of that happening again, but it has not
    come to pass.
    
    Instead, various friendly forks were created, with
    [Limnoria](https://github.com/ProgVal/Limnoria) seeming to have the most
    momentum.  Under the watchful eye of Valentin "ProgVal" Lorentz, a successful
    community has developed and worked to shepherd Supybot onward.

    Supybot-master.zip

  6. What is Dancer?

    Dancer is an IRC bot. A bot is an automated client for Internet Relay Chat networks, which stays online after its owner leaves. It was designed to protect and serve. Your faithful, strong (but humble) servant. Yes, ladies. This is one bot who will not cheat on you.

    Dancer was developed in C, and is mostly POSIX compliant. It runs on most of the UNIX flavors you have used, and a few you haven't heard of. It also runs on Win32 and AmigaOS.

    dancer-4.16.tar.gz

  7. About Gyach Enhanced / pY! Voice Chat

    Welcome to the home of Gyach Enhanced (Gyach-E) and pY! Voice Chat. Gyach Enhanced is currently THE most feature-rich Yahoo! client for Linux operating systems. It is an unofficial fork of the original Gyach, and supports almost all of the features you would expect to find on the official Windows Yahoo! client: Voice chat, webcams, faders, 'nicknames', audibles, avatars, display images, and more. Yet, it remains very light-weight and memory-friendly. Gyach Enhanced, pY! Voice Chat, and the Gyach-E Webcam Utilities all use Gtk-2 for their user interfaces (Gtk-2 2.0.6 or better required).

    gyache14.png
    GYach Enhanced Yahoo AddressBook support shown here   [Click to enlarge]



    Gyach Enhanced is intended to be a deliberate departure from the growing trend of 'multi-protocol'/'multi-platform' messaging and chat clients which often suffer from half-baked or non-existent support for major features such as voice, webcams, privacy, security, and spam control, and generally offer slower adoption of new protocol features that Windows users have access to almost immediately with each new Y! Messenger release. Gyach Enhanced is never intended to be a 'multi-protocol' application (i.e., not intended for connecting to MSN, AIM, etc.) as I would rather use a client that handles one messaging system and handles it well, than a client that handles only the 'basics' on several systems.

    Gyach-E is about PROGRESS: Being among the first, not the last, to implement support for new features. Lately, Gyach Enhanced has been adopting new features at an alarming rate, as the development has not been bogged down with a need to rewrite/recompile code for Windows and other operating systems or a need to 'delay' the addition of new features for fear of its affects on other protocols' 'plugins'. In other words: New features are added quickly because I do not have to worry if something will work on Windows or if the new addition will break MSN support...Gyach Enhanced just worries about Yahoo! on Linux: That's it. "One protocol, one OS...done well.". Gyach Enhanced is also the first Yahoo application for Linux with support for the vast majority of the new features added to the Windows Y! Messenger 6: Display Images in the PM window, Avatars, Audibles, and Stealth Settings.

    While other applications prefer to focus on things such as 'themeable smileys'...Gyach Enhanced is focused on USEFUL features such as webcam support, voice chat, controlling spam (about 75-95% effective), and doing the best it can to prevent you from being booted, 'bombed', 'flooded', and stalked. Gyach-E is known to survive tons of different 'boot codes' and is constantly being patched to defend against new ones as I find out about them. For example, when support for Audibles was added to Gyach-E, I also anticipated that people would eventually start using Audibles to 'flood' people and send Audible 'spam', so I also implemented measures to help defend against these types of abuse. This is part of the concept behind Gyach-E: Allow the user to enjoy the latest features while containing and minimizing any 'damage' that can be caused by people abusing the new features. The program responds intelligently to 'boot' attacks by temporarily shutting down sound events and dialog boxes to avoid X and sound card-related crashes, controlling the flow of incoming network packets, minimizing CPU usage during an 'attack', auto-ignoring users as necessary, monitoring and logging suspcious events, and sometimes, even booting the bot/person that's trying to boot you. 🙂

    Together with pY! Voice Chat, the Gyach-E Webcam utilities, and a few light-weight plugins (including encryption support), Gyach Enhanced is the most advanced, feature-rich Linux client for Yahoo! thus far. It is the first (and, to my knowledge, the ONLY) Linux Y! client that supports both voice chat and webcams (sending and receiving.)

    GYachl.jpg

    gyachi-1.2.6.tar.gz

  8. leetIRC is a freeware Internet Relay Chat (IRC) client designed for maximum functionality on older/obsolete systems running MS-DOS or 100% compatible OS (win32 port also, soon). Main features include drop-down menus, DCC file receive, mIRC color/bold cod

     

     

    leet.jpg

    lirc11.zip

  9. BitchX is an IRC client based on ircII/EPIC4. It includes many features that are usually relegated to scripts such as CDCC and flood protection -- you can just start it and go. Development was on hiatus for a while but is now resuming.

     

     

    1.jpg

    bitchx-1.2.1.tar.gz

  10. The Linux Mint development team has announced the release of Linux Mint 21.1, codenamed "Vera." The release will likely be a welcome holiday gift for its users.

    What's New in Linux Mint 21.1?

    Linux Mint, which had already been promised for release in December 2022, has a number of new features.

    The developers detailed the new features on the official release page.

    Linux Mint 21.1 was given a fresh look and feel.

    The operating system looks cleaner and more modern. It's also more configurable and comes packed with a variety of themes.

    The most noticeable change from the new version is what's missing. The desktop icons have been hidden to reduce clutter. This is true of the flagship Cinnamon desktop as well as the MATE and Xfce editions.

    Read More Here

  11. Does Windows cost too much? Here are several free alternative operating systems. Linux is just the beginning!

     
     Need a new operating system that doesn't cost a penny? You might have heard about Linux, the free and open-source alternative to Windows. However, there are many other free operating systems for laptops and desktop PCs.

    Capable of performing standard computing tasks, these free operating systems are strong alternatives to Windows.

    Read more here

     
     
  12. Servers and IRCd's Upgraded

    On Sunday, January 01, 2023, we upgraded the VPS's running the IRCd's and upgraded the IRCd's to the newest release of InspIRCd. 

    At the same time, we made a few changes and update some things. The IRCd's now use a wildcard letsencrypt SSL certificate. 

    The network infrastucture now is:
    cs1.coders-irc.net - Newark New Jersey USA
    cs2.coders-irc.net - Montreal Quebec Canada
    cs3.coders-irc.net - London, England

    ipv6.coders-irc.net - ipv6 server for coders.
    irc.coders-irc.net - round robin address for coders.

  13. ━═★[̲̅̅H̲̅][̲̅̅A̲̅][̲̅̅P̲̅][̲̅̅P̲̅][̲̅̅Y̲̅] [̲̅̅B̲̅][̲̅̅I̲̅][̲̅̅R̲̅][̲̅̅T̲̅][̲̅̅H̲̅][̲̅̅D̲̅][̲̅̅A̲̅][̲̅̅Y̲̅]★═━ err0r

    To a Good friend that has always been there for me & others, I like to wish you all the best on your special day & wish you a Happy Birthday  & many more to come my friend!!

    c6bb2ab3bfc5240586c327d42049ffdd.jpg

  14. meh just a snake game....i made this like a year ago when i was just learning java 😜

    i was bored and saw no one has posted one so i figure i'll post the first one. 🙂

    *known bugs:

    1. can't restart without refreshing page
    2. rapid movement causes snake to turn back into self

    URL: http://picklecodes.co.cc/Games/Snake/

     

    import java.awt.*;
    import java.applet.*;
    import java.awt.event.*;
    import java.util.*;
    
    public class Snake extends Applet implements KeyListener,  Runnable
    {
      // The object we will use to write with instead of the standard screen graphics
      Graphics bufferGraphics;
      // The image that will contain everything that has been drawn on
      // bufferGraphics.
      Image offscreen;
      // To get the width and height of the applet.
      Dimension dim;
      Random r=new Random();
      Level level=new Level();
    
      boolean playedLastGame=false;
      int bodies=2;
      int lives=3;
      int countApple=0;
      Wall[] w = new Wall[500];
      Section[] s=new Section[300];
      Apple[] a=new Apple[10];
      MovePoint[] mp=new MovePoint[100];
    
      //credits
      String version = "1.0";
      boolean game,puase;
      boolean gameOver;
      int GameOverTimer=0;
      int x,y;
    
      //timer
      Thread t,t1;
    
      public void start(){
      t = new Thread(this);
      t.start();
    }
    
    public void run(){
        t1 = Thread.currentThread();
        while(t1 == t){
            updateSpace();
            try{
                 t1.sleep(100);    
                }catch(InterruptedException e){}
            }
    }
    
    public void init() {
      // We'll ask the width and height by this
      dim = getSize();
      setBackground(Color.black);
      // Create an offscreen image to draw on
      // Make it the size of the applet, this is just perfect larger
      // size could slow it down unnecessary.
      offscreen = createImage(dim.width,dim.height);
      // by doing this everything that is drawn by bufferGraphics
      // will be written on the offscreen image.
      bufferGraphics = offscreen.getGraphics(); 
    
      for (int i=0; i < s.length; i++) { s[i]=null; }
      for (int i=0; i < w.length; i++) { w[i]=null; }
      for (int i=0; i < a.length; i++) { a[i]=null; }
      for (int i=0; i < mp.length; i++) { mp[i]=null; }
      level.setLevel(0);
    
      this.setFocusable(true);
      this.requestFocus();
     addKeyListener(this);
     game=false;
    }
    
    public void reinit() 
    {
    int tempGoal = level.getGoal();
    level.reset();
    level.setGoal(tempGoal + 5);
    bodies=2;
    countApple=0;
    
      for (int i=0; i < s.length; i++) { s[i]=null; }
      for (int i=0; i < w.length; i++) { w[i]=null; }
      for (int i=0; i < a.length; i++) { 
                a[i]=new Apple(); 
                a[i].init();
            for (int ii=0; ii < w.length; ii++) {
                if (w[ii] != null) {
    while (w[ii].x == a[i].x && w[ii].y == a[i].y) { a[i].init(); ii=0; }
    }
    }
    
        }
      for (int i=0; i < mp.length; i++) { mp[i]=null; }
      s[0]=new Section();
      s[1]=new Section();
      s[2]=new Section();
      s[0].init(250,250,"right");
      s[1].init(245,250,"right");
      s[2].init(240,250,"right");
      s[0].setHead(true);
            puase=true;
    }
    
    public boolean updateSpace() {
      // Wipe off everything that has been drawn before
      // Otherwise previous drawings would also be displayed.
      bufferGraphics.clearRect(0,0,dim.width,dim.height);
    
    if (game == false) {
    if (gameOver == true) {
     bufferGraphics.setColor(Color.green);
     bufferGraphics.drawString("Game Over!",dim.width / 2 - 100,dim.height / 2);
     GameOverTimer++;
     if (GameOverTimer >= 10) { 
         gameOver=false;
         GameOverTimer=0;
        }
    }
    else {
     bufferGraphics.setColor(Color.green);
     bufferGraphics.drawString("Pickled Snake",dim.width / 2 - 100,dim.height / 2);
     bufferGraphics.drawString("Press Space to Start ",dim.width / 2 - 100,dim.height / 2 + 15);
    }
    }
    else {
    
    if (puase != true) {
      level.time+=0.1;
      level.time=Round(level.time,1);
    }
    
      for (int i=0; i < s.length; i++) {
        if (s[i] != null) {
            if (puase != true) { s[i].move(); }
          //check collsion with apples
          if (bodies <= s.length) {
            for (int ii=0; ii < a.length; ii++) {
                if (a[ii] != null) {
              if (s[0].x == a[ii].x && s[0].y == a[ii].y) {   
                int X=s[bodies].x;
                int Y=s[bodies].y;
                String D=s[bodies].direction;
                bodies++;
                if (D == "up") {
                  s[bodies]=new Section();
                  s[bodies].init(X, Y+5, D);
                }
                if (D == "down") {
                  s[bodies]=new Section();
                  s[bodies].init(X, Y-5,  D);
                }
                 if (D == "right") {
                  s[bodies]=new Section();
                  s[bodies].init(X-5, Y, D);
                }
                 if (D == "left") {
                  s[bodies]=new Section();
                  s[bodies].init(X+5, Y, D);
                }
                     a[ii].init();
                      for (int iii=0; iii < w.length; iii++) {
                if (w[iii] != null) {
             while (w[iii].x == a[ii].x && w[iii].y == a[ii].y) { a[ii].init(); iii=0; }
        }
    }
                  countApple++;
                  break;
              }
            }
           }
          }
           //check if snake section collides with self
    
                  if (i != 0 && s[0].x == s[i].x && s[0].y == s[i].y || s[0].x < 0 || s[0].y < 0 ||  s[0].x > dim.width  || s[0].y > dim.height) { 
                      LoseLive();
                      return false;
                }
    
     //check if snake section is over move point if so then move in the direction told by move point
          for (int ii=0; ii < mp.length; ii++) {
            if (mp[ii] != null) {
              if (s[i].x == mp[ii].x && s[i].y == mp[ii].y) { 
                s[i].direction=mp[ii].direction;
                if (bodies == i) { mp[ii]=null; }
              }
            }
          }
          s[i].Paint(bufferGraphics);
        }
      }
              //paint walls
                   for (int i=0; i < w.length; i++) { 
                       if (w[i] != null) {
                         //check if snake section collides with a wall
                       if (s[0].x == w[i].x && s[0].y == w[i].y) {
                         LoseLive();
                         return false;
                        } 
                       w[i].Paint(bufferGraphics);
                    }
                    }
      for (int i=0; i < a.length; i++) {
        a[i].Paint(bufferGraphics);
      }
    
        //check the level goal
                if (countApple >= level.getGoal()) { 
                    level.setLevel(level.getLevel() + 1);
                    reinit();
                }
    
      bufferGraphics.setColor(Color.orange);
      bufferGraphics.drawString("Time: "+ level.time,10,15);
      bufferGraphics.drawString("Lives: "+ lives,80,15);
      bufferGraphics.drawString("Level: "+ level.getLevel(),(dim.width / 2) - 75,15);
      bufferGraphics.drawString("Goal: "+ level.getGoal(),dim.width - 100,15);
      bufferGraphics.drawString("Apples:  "+ countApple,dim.width - 100,30);
    
      if (puase == true) {
    bufferGraphics.setColor(Color.green);
    bufferGraphics.drawString("Puase ",dim.width / 2 ,dim.height / 2);
    }
    
    }
    
     repaint();
     return true;
    }
    /** this controls the lives */
    public void LoseLive() { 
    lives--;
    if (lives <= 0) { EndGame(); }
    reinit();
    }
    /** this ends the game */
    public void EndGame() { 
    resetGame();
    gameOver=true;
    game=false; 
    }
    /** this resets the game and destroys everything not being used */
    public void resetGame() {
    level.reset();
    lives=3;
     for (int i=0; i < s.length; i++) { s[i]=null; }
      for (int i=0; i < w.length; i++) { w[i]=null; }
      for (int i=0; i < a.length; i++) { a[i]=null; }
      for (int i=0; i < mp.length; i++) { mp[i]=null; }
    }
    //paint
    public void paint(Graphics g) 
    {
    
      //credits
      bufferGraphics.setColor(Color.orange);
      bufferGraphics.drawString("Java Snake game "+ version,10,470);
      bufferGraphics.drawString("By: Pickle",10,480);
    
      // draw the offscreen image to the screen like a normal image.
      // Since offscreen is the screen width we start at 0,0.
      g.drawImage(offscreen,0,0,this); 
    }
    public void update(Graphics g)  { paint(g); } 
    
    //key events
    public void keyPressed(KeyEvent e ) { 
    if (puase != true) {
      switch (e.getKeyCode()) {
        case KeyEvent.VK_LEFT:  
        if (s[0].direction == "left" || s[0].direction == "right") {}
    else {
          s[0].direction="left";
          for (int i=0; i < mp.length; i++) {
            if (mp[i] == null) {
              mp[i]=new MovePoint();
              mp[i].init(s[0].x,s[0].y,"left");
              break;
            }
          }
        }
        break;
        case KeyEvent.VK_RIGHT:
        if (s[0].direction == "left" || s[0].direction == "right") {}
    else {
          s[0].direction="right";
          for (int i=0; i < mp.length;  i++) {
                  if (mp[i] == null) {
               mp[i]=new MovePoint();
              mp[i].init(s[0].x,s[0].y,"right");
              break;
            }
          }
        }
        break;
        case KeyEvent.VK_UP: 
        if (s[0].direction == "up" || s[0].direction == "down") {}
    else {
          s[0].direction="up";
          for (int i=0; i < mp.length;  i++) {
                  if (mp[i] == null) {
              mp[i]=new MovePoint();
              mp[i].init(s[0].x,s[0].y,"up");
              break;
            }
          }
        }
        break;
        case KeyEvent.VK_DOWN:  
        if (s[0].direction == "up" || s[0].direction == "down") {}
    else {
          s[0].direction="down";
          for (int i=0; i < mp.length;  i++) {
                  if (mp[i] == null) {
              mp[i]=new MovePoint();       
              mp[i].init(s[0].x,s[0].y,"down");
              break;
            }
          }
        }
        break;
        case KeyEvent.VK_SPACE:  
        if (game == false) {
        game=true; 
        reinit();
    }
        break;
      }
    }
    
       if (e.getKeyChar() == 'p') {
        if (puase == true) { puase=false; }
    else { puase=true; }
    }
    
    }
    
    public void keyReleased( KeyEvent e ) { }
    public void keyTyped( KeyEvent e ) {}
    
    //for my rounding needs
    public static float Round(float Rval, int Rpl) {
      float p = (float)Math.pow(10,Rpl);
      Rval = Rval * p;
      float tmp = Math.round(Rval);
      return (float)tmp/p;
    }
    
    /**
     * records Level Info
     */
    private class Level {
    int level = 0;
    int goal=0;
    float time = 0.0f;
    public Level() { }
    
    public void reset() {
    goal=0;
    time = 0.0f;
    }
    public void setLevel(int l) { level=l; }
    public void setGoal(int g) { goal=g; }
    public int getLevel() { return level; }
    public int getGoal() { return goal; }
    }
    
    /**
    *  record snake sections
    */
    private class Section {
      int x,y;
      String direction=null;
      boolean head=false;
      public Section() { }
      public void init(int X, int Y,  String B) {
        direction=B;
        x=X;
        y=Y;
      }
      public void setHead(boolean h) { head=h; }
      public void move() {
        if (direction == "up") { y-=5; }
        if (direction == "down") { y+=5; }
        if (direction == "right") { x+=5; }
        if (direction == "left") { x-=5; }
      }
      public void Paint(Graphics g) {
          g.setColor(Color.green);
          g.fillOval(x,y,5,5);
          if (head == true) { 
          g.setColor(Color.black);
          g.fillOval(x - 2,y - 2,2,2);
          g.fillOval(x - 4,y - 2,2,2);
        }
      }
      //end class section
    }
    
    /**
    * record Move point
    */
    private class MovePoint {
      int x,y;
      String direction;
      public MovePoint() {  }
      public void init(int X, int Y, String B) {
        direction=B;
        x=X;
        y=Y;
      }
      //end class section
    }
    /**
    *Draw Wall Randomly
    */
    private class Wall  {
      int x,y;
      public Wall() { }
      public void init(int X, int Y) { 
        x=X - (X % 5);
        y=Y - (Y % 5);
      }
      public void Paint(Graphics g) {
          g.setColor(Color.gray);
          g.fillOval(x,y,5,5);
      }
      //end class Wall
    }
    
    /**
    *Draw Apple Randomly
    */
    private class Apple {
      int x,y;
      public Apple() { }
      public void init() { 
        int rand=r.nextInt(dim.width);
        x=rand - (rand % 5);
        rand=r.nextInt(dim.height);
        y=rand - (rand % 5);
      }
      public void Paint(Graphics g) {
          g.setColor(Color.red);
          g.fillOval(x,y,5,5);
      }
      //end class apple
    }
    
    //end
    }

     

  15. This is a fun little script I made a while back. It fits perfectly with truth or dare games. (I dare you to type !kickme) It was a completely random idea me and my brother came up with.

    Commands:
    !kickme
    !banme
    !kickbanme

    Bans for 30 seconds.

    on *:Text:*:#:{
    if ($1 == !kickme) { kick # $nick Kicked on request }
      elseif ($1 == !kickbanme) { ban -ku30 # $nick 2 Kick + 30 second ban by request }
      elseif ($1 == !banme) { ban -u30 # $nick 2 | msg # $nick activated a 30 second ban by request. }
    }
    on *:Text:*:#:{
    if ($1 == !kickme) { kick # $nick Kicked on request }
      elseif ($1 == !kickbanme) { ban -ku30 # $nick 2 Kick + 30 second ban by request }
      elseif ($1 == !banme) { ban -u30 # $nick 2 | msg # $nick activated a 30 second ban by request. }
    }

     

    on *:Text:*:#:{
    if ($1 == !kickme) { kick # $nick Kicked on request }
      elseif ($1 == !kickbanme) { ban -ku30 # $nick 2 Kick + 30 second ban by request }
      elseif ($1 == !banme) { ban -u30 # $nick 2 | msg # $nick activated a 30 second ban by request. }

     

    On *:Text:!kickbanme:#: {
      /kick $chan $nick Kick + 30 second ban by request
      mode $chan +b $nick
      .timer 1 30 mode $chan -b $nick
    }

     

    can be also rewritten as
    on *:text:!kickbanme:#: { !ban -ku30 # $nick Kick + 30 second ban by request }The -k switch means to 'kick', and the u30 switch means to (unban or unset, either one works) in N seconds. The 2 after the $nick is the ban mask. The kind of ban mask you supplied wasn't a real one as it was a nick ban. I prefer using mask 2 as it is the most "unique" ban mask out of all of them.
    In this situation where you're "playing around", almost any ban mask is fine, unless you share a channel with a few dozen New Yorkers with the same ISP. You can use the same concept that I used, but with the "ban me".

    If you noticed, I put

    /!ban

    instead of

    /ban

    .
    Using ! before a command means taking the original one (very useful when dealing with common mIRC default aliases such as /kick and /ban). This means it won't take any modified aliases that a person who might use this script has; it's safer this way, and can prevent errors.

×
×
  • Create New...