isit posible to make mainchat recordbot
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

isit posible to make mainchat recordbot

Started by miku82, 04 May, 2005, 08:06:10

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

miku82

witsh counts  ho talkin  moust on main chat 8)

Dessamator

it already exists, search for chatstats !!
Ignorance is Bliss.

miku82

QuoteOriginally posted by Dessamator
it already exists, search for chatstats !!

wath comadn it use  i cant get  it to work
 ?(

Dessamator

these are the commands :
Quote!mychatstat
!topchatters
!delchatter
!clearchatstats
Ignorance is Bliss.

miku82

QuoteOriginally posted by Dessamator
these are the commands :
Quote!mychatstat
!topchatters
!delchatter
!clearchatstats


dam  :rolleyes: it woun?t work

Dessamator

ok then just, show me what chatstats u are using, and we'll see !!
Ignorance is Bliss.

miku82

#6
QuoteOriginally posted by Dessamator
ok then just, show me what chatstats u are using, and we'll see !!


botname = "ChatStat"


ChatStat={}

ChatStatCounter=0


function Main()

frmHub:RegBot(botname)

end


function reset()

ChatStat={}

ChatStatCounter=0

end


function save_stats(user)

    remove("chatstat.dat")

    local handle=openfile("chatstat.dat","a")

    write(handle,ChatStatCounter.."\n")

    for a,b in ChatStat do

        write(handle,a.."?"..b.."\n")

    end

    closefile(handle)

    user:SendPM(botname,"Chatstat has been successfully saved ...")


end


function load_stats(user)

   local handle=openfile("chatstat.dat","r")

    ChatStatCounter=read(handle)

    Poll={}

    while 1 do

      local line = read(handle)

       if line == nil then break

      else

         x,y,a=strfind(line,"([^?]*)")

         x,y,b=strfind(line,"([^?]*)$")

         SendToAll("DEBUG",a..""..b)

         ChatStat[a]=tonumber(b)   

      end

   end

    closefile(handle)


    user:SendPM(botname,"Chatstat has been successfully loaded ...")


end




function show_top5(userobj)

local index1, key1

local index2, key2

local index3, key3

local index4, key4

local index5, key5

key1=0

key2=0

key3=0

key4=0

key5=0


for a,b in ChatStat do

if (ChatStat[a]>key1) then

index5=index4

key5=key4

index4=index3

key4=key3

index3=index2

key3=key2

index2=index1

key2=key1

index1=a

key1=ChatStat[a]

else

if (ChatStat[a]>key2) then

index5=index4

key5=key4

index4=index3

key4=key3

index3=index2

key3=key2

index2=a

key2=ChatStat[a]

else

if (ChatStat[a]>key3) then

index5=index4

key5=key4

index4=index3

key4=key3

index3=a

key3=ChatStat[a]

else

if (ChatStat[a]>key4) then

index5=index4

key5=key4

index4=a

key4=ChatStat[a]

else

if (ChatStat[a]>key5) then

index5=a

key5=ChatStat[a]

end

end

end

end

end

end


userobj:SendPM(botname,"Top 5 poster in this hub : \r\n")

userobj:SendPM(botname,"* Nr.   Posts : Name..........")

if (index1~=nil) then

userobj:SendPM(botname,"* 1.     "..ChatStat[index1].."  :   "..index1)

end

if (index2~=nil) then

userobj:SendPM(botname,"* 2.     "..ChatStat[index2].."  :   "..index2)

end


if (index3~=nil) then

userobj:SendPM(botname,"* 3.     "..ChatStat[index3].."  :   "..index3)

end


if (index4~=nil) then

userobj:SendPM(botname,"* 4.     "..ChatStat[index4].."  :   "..index4)

end


if (index5~=nil) then

userobj:SendPM(botname,"* 5.     "..ChatStat[index5].." :   "..index5)

end

end


function GetCommand(data)

   s,e,whoTo,from,cmd = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(%S+)")

   return cmd

end


function DataArrival(user, data)

if (( strsub(data, 1, 1) == "<" ) or ( strsub(data, 1, 4) == "$To:" )) then


if (ChatStat[user.sName] == nil) then

ChatStat[user.sName]=1

else

ChatStat[user.sName]=ChatStat[user.sName]+1

end

ChatStatCounter=ChatStatCounter+1

end

if(strsub(data, 1, 4) == "$To:") then

s,e,whoTo,from,cmd = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(%S+)")

cmd=strsub(cmd,1,strlen(cmd)-1)


if (whoTo == botname) then

if (cmd=="+showstat")then

show_top5(user)

end

if (user.bOperator) then

if (cmd=="+savestat")then

save_stats(user)

end

if (cmd=="+loadstat")then

load_stats(user)

end

end



end

end


end


i tryid  thous  you gave to mi  and thous   cmd text from the script

Dessamator

the commands are
+showstat +loadstat and +savestat
Ignorance is Bliss.

miku82

QuoteOriginally posted by Dessamator
the commands are
+showstat +loadstat and +savestat


i hav tryid  thous  bud thei dosen?t  work

Dessamator

what ptokax version are u using?, and if ur using the new ptokax , search for the script in the lua5 section, and the commands are the first ones i posted !
Ignorance is Bliss.

miku82

QuoteOriginally posted by Dessamator
what ptokax version are u using?, and if ur using the new ptokax , search for the script in the lua5 section, and the commands are the first ones i posted !

thanx buddy

SMF spam blocked by CleanTalk