general Posted August 28, 2007 Report Share Posted August 28, 2007 i made this system for user's help, though it works fine but i want to add few more thing in it...which im not getting understand how to do it properly...in this regard i need help with following things:- 1. i want add feature that script should show how many users has been complained, mean number of users or nicks should be shown like it shows in kickloger system.. 2.suppose there are total 20 usere had made complaints....n i want to read complain no 16 how wud it work with command? #messagebot on on *:join:#: { if (%messagebot = On) && ($me isop $chan) { if ($nick == $me) halt ctcpreply $nick TIME ï€ -=[ Problem Reporting is on ]=-
-=[ Type !problem to read detail ]=-
-=[ !complain your message for record you complain ]=-
-=[ !suggest your message for record your suggestions ]=- } } on *:text:*!problem*:*: { /ctcpreply $nick TIME ï€ -=[ Record Your Problems ]=-
-=[ You can complain about Hosts,Owners,Scripts users etc ]=-
-=[ Or make a suggestion about any thing ]=-
-=[ We will try our best to resolve your concern ]=-
-=[ Just Type: !complain or !suggest and your message ]=- } on *:text:*!complain*:*: { write Complaints/complaints.ini $nick Complained that: $2- /privmsg # 
-=[ $nick your complaint has been recoreded ]=- 
-=[ We will try to resolve your concern]=- } on *:text:*!suggest*:*: { write Complaints/suggestion.ini $nick Suggested that: $2- /privmsg # 
-=[ $nick your suggestion has been recoreded ]=- 
-=[ We will consider your suggestion]=- } On *:TEXT:!readsug:#:/msg # S \rTahoma;0 (*) 
 (*) $+ $read Complaints/suggestion.ini 
 Type: !suggestion (You'r suggestion) For Adding suggestion ..(*) On *:TEXT:!readcom:#:/msg # S \rTahoma;0 (*) 
 (*) $+ $read Complaints/complaints.ini 
 Type: !complain (You'r complain) For Adding complain ..(*) On Level5:TEXT:!com*:#:/run Complaints\Complaints.ini On Level5:TEXT:!sug*:#:/run Complaints\suggestion.ini On Level5:TEXT:!clcom*:#: write -c Complaints\Complaints.ini On Level5:TEXT:!clsug*:#: write -c Complaints\suggestion.ini #messagebot end menu menubar { - -=[ Complain Bot ( $+ $group(#messagebot) $+ ) ]=- ..On:{ .enable #messagebot | set %messagebot on | echo -a 0,12Complain Recorder is now $+ 0,94 On } ..Off:{ .disable #messagebot | set %messagebot off | echo -a 0,12Complain Recorder is now $+ 0,4 Off } .Edit ..Complaints:/run Complaints\Complaints.ini ..Suggestions:/run Complaints\suggestion.ini .Clear ..Complaints: write -c Complaints\Complaints.ini ..Suggestions: write -c Complaints\suggestion.ini .- Link to comment Share on other sites More sharing options...
Guest Travis Posted August 28, 2007 Report Share Posted August 28, 2007 (edited) You are using .ini not a .txt file. You should use the ini commands. Complaints: /writeini Complaints/support.ini complaints $nick $2- $readini(Complaints/support.ini,complaints,$nick) Suggestions: /writeini Complaints/support.ini suggestions $nick $2- $readini(Complaints/support.ini,suggestions,$nick) total number of complaints: $ini(Complaints\support.ini,complaints,0) Look at complaint #16: $readini(Complaints\support.ini,complaints,$ini(Complaints\support.ini,complaints,16)) msg $chan $ini(Complaints\support.ini,complaints,16) complained that $readini(Complaints\support.ini,complaints,$ini(Complaints\support.ini,complaints,16)) This would store data like this. File name: Support.ini - [complaints] nickname1=complaint1 nickname2=complaint2 [suggestions] nickname1=suggestion1 nickname2=suggestion2 Edited August 28, 2007 by Travis Link to comment Share on other sites More sharing options...
general Posted August 28, 2007 Author Report Share Posted August 28, 2007 Thanx Travis...for quick reply and helping me with these codes.... Link to comment Share on other sites More sharing options...
general Posted August 28, 2007 Author Report Share Posted August 28, 2007 (edited) One another thing i need to know.... suppose there is a .txt or .ini file in script folder... and there are multi lines in it...which can may poetry,jokes or anyother stuff... how wud script read every line from specified file on command? like On *:TEXT:!readsug:#:/msg # S \rTahoma;0 (*) 
 (*) $+ $read Complaints/suggestion.ini it will read only one msgs ...it wont go to next line... but i want to make script read all lines ...after finishing one it should go to next line till last line and msg to room... Edited August 28, 2007 by general Link to comment Share on other sites More sharing options...
takaharu_ Posted August 28, 2007 Report Share Posted August 28, 2007 With an INI file it's very easy. Say you have a file like this: [section1] A=word B=words are better [section2] A=thing B=things are better To recite Section2 next to A all you need is $readini(file.ini,Section2,A) Link to comment Share on other sites More sharing options...
hixxy Posted September 3, 2007 Report Share Posted September 3, 2007 One another thing i need to know.... suppose there is a .txt or .ini file in script folder... and there are multi lines in it...which can may poetry,jokes or anyother stuff... how wud script read every line from specified file on command? like On *:TEXT:!readsug:#:/msg # S \rTahoma;0 (*) 
 (*) $+ $read Complaints/suggestion.ini it will read only one msgs ...it wont go to next line... but i want to make script read all lines ...after finishing one it should go to next line till last line and msg to room... on *:text:!readsug:#:{ var %handle = handle $+ $ticks, %file = complaints\suggestion.ini if (!$isfile(%file)) { msg $chan There is no suggestions file to read from. } else { .fopen %handle %file if (!$ferr) { while (!$feof) { msg $chan $fread(%handle) } .fclose %handle } } } Link to comment Share on other sites More sharing options...
Guest Travis Posted September 3, 2007 Report Share Posted September 3, 2007 There is also /play. /play $chan filename.txt Link to comment Share on other sites More sharing options...
general Posted September 3, 2007 Author Report Share Posted September 3, 2007 thanx hixxy thats wat i exectly needed...... its works fine ...but a lil bug in it ....thats it do not msg if file is empety ..... otherwise its cool. thanx for codes again Link to comment Share on other sites More sharing options...
Guest Travis Posted September 4, 2007 Report Share Posted September 4, 2007 if (!$lines(file.txt)) halt of start the code with ... if ($lines(file.txt)) { if (!$isfile(%file)) { msg $chan There is no suggestions file to read from. } elseif (!$lines(file.txt)) { msg $chan The file is empty. } else { Link to comment Share on other sites More sharing options...
general Posted September 4, 2007 Author Report Share Posted September 4, 2007 (edited) if (!$isfile(%file)) { msg $chan There is no suggestions file to read from. } elseif (!$lines(file.txt)) { msg $chan The file is empty. } else { i make changes in above mention lines ...and now it is working good if (!$lines(%file)) { msg $chan There is no suggestions file to read from. } Thanx Buddy for helping .... Edited September 4, 2007 by general Link to comment Share on other sites More sharing options...
Recommended Posts