hi
i've been trying to make a code for someone for awhile .i dont know him actualy but he asking me for help to make this kinda file operation code.so i said ok but i can confess now i mess'd up ...
i wrote a code for him and three months later he turns and said "not working well and it has errors".
well honestly i didnt tried that one on my bot.i wrote and gave him .. so i try to re-build this code with using "switch" ..this is my first time i wrote a code with that so its confusing me now.
ok now i'm gonna try to explain what was his request and what he want to do with it. :
its basicly kinda "notification or a notice system" on a channel, channel ops can add/del or list these messages with channel triggers like :
!addnot <number-line/or a name> some-text-here...
!delnot <number-of-line/or-a-name> ..
!listnot
ok these triggers for channel ops.
but important part is ( all issues about this code begins for me now..i couldnt make it this part of code)
if an user joins in eggdrop's private and he/she triggers like : trig <number-line/or-a-name> ... or
trigger <number-line/or-a-name> .. then our eggdrop should post these specific line/s what added by channel ops before into that user'S PM.
so this post method for user/s should work on bot's pm/users pm.
so what i did.
i thought probably "switch" method is a good idea for this kinda code.and first time in my life i've been try that.
i thought i can handle all of that add/del/list file operations into "main proc" and i can creat a "child proc" for that egg's pm to user's PM post job. and then if i can call "main proc" into "child proc" within like "return $main_proc" so it can work into "default" part of the "switch" ... the idea was like that. i hope i can explain correctly enuff.
but in practise i couldn't do it.it wont work like what i wish..i changed couple of time i play on codes ,and tried change possitions or something but nope so i'm hopeless therefor i am here now again,for to asking your help....
here is the code what i have now:
i try to translate Turkish to English for you..
p.s: i still didnt tried this code on my bot.so i dont know what exactly has errors.i didnt,b-cus i already knew that isnt finished yet...and not working.i can see that.
thanks..best regards