IRCForumu.Net - Türkiye'nin IRC ve mIRC Kullanıcılarının Buluştuğu Forum muhabbet


ircforumu sekershell
bizimkiler sosyalchat


Yeni Konu aç Cevapla
 
LinkBack Seçenekler Arama Stil
Alt 01 Temmuz 2016, 18:17   #1
Çevrimdışı
Gelme, burası çok derin.

immortaL - ait Kullanıcı Resmi (Avatar)
OPERS Modulu.


Reklam

Modul /ircops modulu gibi ama .txt deki metni alip RPL_OPERS İLE Kullaniciya veren basit bir modul..

PHP Kod:   Kodu kopyalamak için üzerine çift tıklayın!
#include "config.h"
#include "struct.h"
#include "common.h"
#include "sys.h"
#include "numeric.h"
#include "msg.h"
#include "channel.h"
#include <time.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
#include <io.h>
#endif
#include <fcntl.h>
#include "h.h"
#include "proto.h"
#ifdef STRIPBADWORDS
#include "badwords.h"
#endif
#ifdef _WIN32
#include "version.h"
#endif
#define RPL_OPERS  337
#define MSG_opers "opers"
#define TOK_opersx "lr" 
#define tox "#Opers"
#define MSG_opersmotd "opersmotd"
#define TOK_opersmotdx "omx"
aClient *sptr;
aChannel *chptr;
char *text;
DLLFUNC int m_opersmotd(aClient *sptr);
DLLFUNC int m_opers(aClient *cptraClient *sptrint parcchar *parv[]);
#define aciklama "m_opers Operler Bilgileri gosterme Modulu (toXic)"
#define aciklama2 "Operler Bilgileri gosterme Modulu (toXic)"
#define aciklama3 "Opers"
#define versiyon     "3.2-b8-1"
ModuleHeader MOD_HEADER(m_opers)
= {
aciklama,
aciklama2,
aciklama3,
versiyon,
NULL 
};
DLLFUNC int MOD_INIT(m_opers)(ModuleInfo *modinfo)
{
add_CommandX(MSG_opersTOK_opersx,  m_opers1M_UNREGISTERED|M_USER|M_VIRUS);
MARK_AS_OFFICIAL_MODULE(modinfo);
return 
MOD_SUCCESS;
}
 
DLLFUNC int MOD_LOAD(m_opers)(int module_load)
{
return 
MOD_SUCCESS;
}
 
DLLFUNC int MOD_UNLOAD(m_opers)(int module_unload)
{
if (
del_Command(MSG_opersTOK_opersxm_opers) < 0
{
sendto_realops("Bir hata Olustu.. %s",
MOD_HEADER(m_opers).name);
}
return 
MOD_SUCCESS;
}
 
DLLFUNC int m_opers(aClient *cptraClient *sptrint parcchar *parv[])

 
/*
 if  (!sptr || !sptr || !chptr || !text) {
  return text;
 }
 if (!strcmp(text, "!opers")) {
*/
 // dosya islemleri.
#define OKU "opers.txt"
int i;
FILE *dosya;
char buf[BUFSIZE];
dosya fopen(OKU"r");
if (
dosya != NULL) {
while (
fgets(bufsizeof(buf), dosya)) {
buf[strlen(buf)-1] = 0;
if ((
chptr find_channel(toxNullChn)) != NullChn)
sendto_channel_butone(&me, &mechptr":OPERS PRIVMSG  %s %s  Kullanicisi, \2OPERS\2 Komutunu Kullandi."toxsptr->name);
sendto_one(sptr":%s %d %s :%s"me.nameRPL_OPERSsptr->namebuf);
 
}
// Dosyaya Yazdirma..
 
time_t irc_time;
                 
struct tm tdate;
                 
irc_time time(NULL);
                 
tdate = *localtime(&irc_time);
                 
FILE pFile;
                 
pFile fopen ("operskullananlar.txt""a");
                 
fprintf (pFile"Tarih: %02d-%02d-%02d Saat: %02d:%02d Nick: %s  IP: %s \n"tdate.tm_mdaytdate.tm_mon 1
                 
tdate.tm_year 100tdate.tm_hourtdate.tm_minsptr->name,  sptr->user->realhost);
                 
fclose (pFile);
 
//  HATADA Operlere Bildirim..
} else {
 
sendto_realops("Opers: %s !opers Komutunu Kullandi, fakat, Bir hata ile karsilasti..",
                         
sptr->name);
// Kullaniciya bildirim.
sendto_one(cptr":%s NOTICE %s HATA Olustu.\n"me.namesptr->name);
return 
0;
}
   } 

Modul /ircops modulu gibi ama .txt deki metni alip RPL_OPERS İLE Kullaniciya veren basit bir modul..

PHP Kod:   Kodu kopyalamak için üzerine çift tıklayın!
#include "config.h"
#include "struct.h"
#include "common.h"
#include "sys.h"
#include "numeric.h"
#include "msg.h"
#include "channel.h"
#include <time.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
#include <io.h>
#endif
#include <fcntl.h>
#include "h.h"
#include "proto.h"
#ifdef STRIPBADWORDS
#include "badwords.h"
#endif
#ifdef _WIN32
#include "version.h"
#endif
#define RPL_OPERS  337
#define MSG_opers "opers"
#define TOK_opersx "lr" 
#define tox "#Opers"
#define MSG_opersmotd "opersmotd"
#define TOK_opersmotdx "omx"
aClient *sptr;
aChannel *chptr;
char *text;
DLLFUNC int m_opersmotd(aClient *sptr);
DLLFUNC int m_opers(aClient *cptraClient *sptrint parcchar *parv[]);
#define aciklama "m_opers Operler Bilgileri gosterme Modulu (toXic)"
#define aciklama2 "Operler Bilgileri gosterme Modulu (toXic)"
#define aciklama3 "Opers"
#define versiyon     "3.2-b8-1"
ModuleHeader MOD_HEADER(m_opers)
= {
aciklama,
aciklama2,
aciklama3,
versiyon,
NULL 
};
DLLFUNC int MOD_INIT(m_opers)(ModuleInfo *modinfo)
{
add_CommandX(MSG_opersTOK_opersx,  m_opers1M_UNREGISTERED|M_USER|M_VIRUS);
MARK_AS_OFFICIAL_MODULE(modinfo);
return 
MOD_SUCCESS;
}
 
DLLFUNC int MOD_LOAD(m_opers)(int module_load)
{
return 
MOD_SUCCESS;
}
 
DLLFUNC int MOD_UNLOAD(m_opers)(int module_unload)
{
if (
del_Command(MSG_opersTOK_opersxm_opers) < 0
{
sendto_realops("Bir hata Olustu.. %s",
MOD_HEADER(m_opers).name);
}
return 
MOD_SUCCESS;
}
 
DLLFUNC int m_opers(aClient *cptraClient *sptrint parcchar *parv[])

 
/*
 if  (!sptr || !sptr || !chptr || !text) {
  return text;
 }
 if (!strcmp(text, "!opers")) {
*/
 // dosya islemleri.
#define OKU "opers.txt"
int i;
FILE *dosya;
char buf[BUFSIZE];
dosya fopen(OKU"r");
if (
dosya != NULL) {
while (
fgets(bufsizeof(buf), dosya)) {
buf[strlen(buf)-1] = 0;
if ((
chptr find_channel(toxNullChn)) != NullChn)
sendto_channel_butone(&me, &mechptr":OPERS PRIVMSG  %s %s  Kullanicisi, \2OPERS\2 Komutunu Kullandi."toxsptr->name);
sendto_one(sptr":%s %d %s :%s"me.nameRPL_OPERSsptr->namebuf);
 
}
// Dosyaya Yazdirma..
 
time_t irc_time;
                 
struct tm tdate;
                 
irc_time time(NULL);
                 
tdate = *localtime(&irc_time);
                 
FILE pFile;
                 
pFile fopen ("operskullananlar.txt""a");
                 
fprintf (pFile"Tarih: %02d-%02d-%02d Saat: %02d:%02d Nick: %s  IP: %s \n"tdate.tm_mdaytdate.tm_mon 1
                 
tdate.tm_year 100tdate.tm_hourtdate.tm_minsptr->name,  sptr->user->realhost);
                 
fclose (pFile);
 
//  HATADA Operlere Bildirim..
} else {
 
sendto_realops("Opers: %s !opers Komutunu Kullandi, fakat, Bir hata ile karsilasti..",
                         
sptr->name);
// Kullaniciya bildirim.
sendto_one(cptr":%s NOTICE %s HATA Olustu.\n"me.namesptr->name);
return 
0;
}
   } 

  Alıntı ile Cevapla

IRCForumu.Net - Reklam Alanı

Cevapla

Etiketler
modulu, opers
IRCForumu.Net - Sponsor Bağlantılar


Seçenekler Arama
Stil

Yetkileriniz
Konu Acma Yetkiniz Yok
Cevap Yazma Yetkiniz Yok
Eklenti Yükleme Yetkiniz Yok
Mesajınızı Değiştirme Yetkiniz Yok

BB code is Açık
Smileler Açık
[IMG] Kodları Açık
HTML-Kodu Kapalı
Trackbacks are Açık
Pingbacks are Açık
Refbacks are Açık